From dddf79cd0e1ac1c79d10d9802bf90ee1600e16aa Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 10 Feb 2020 21:57:10 +0900 Subject: Allow starting afresh with a new ID3v2.3 tag --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 5af6eb1..7c8b34c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,6 +19,10 @@ fn parse_options_into(opt: &mut Options) { .add_option(&["-w", "--write"], StoreTrue, "Write updated information instead of just displaying. Unmodified or unknown tags are preserved as-is."); + ap.refer(&mut opt.clean) + .add_option(&["--clean"], StoreTrue, + "Remove any existing fields in ID3v2.* tag, and convert to ID3v2.3 (pending commit with --write)"); + ap.refer(&mut opt.latin1_as_utf8) .add_option(&["--assume-utf8"], StoreTrue, "Assume that all strings specified in the MP3 as Latin-1 are really UTF-8."); @@ -122,6 +126,12 @@ fn main() -> io::Result<()> { tag }; + if options.clean { + tag.frames.clear(); + tag.version_sub = 3; + eprintln!("NOTE: Removed all existing fields and set version sub to 3 (to make an ID3v2.3 tag)"); + } + if options.latin1_as_utf8 { for frame in &mut tag.frames { if let Some(new_frame) = -- cgit v1.2.3