From ca474f076d2b15a881d77566a49807cfebb44d3e Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Mon, 23 Jan 2023 15:06:49 -0800 Subject: [PATCH] new version, 3.6.00 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The initial mp3 based review of tagging led to a major update: the new TagList class/package for --taglist. This sends acxi to 3.6.00 since this is a significant set of new features, and creates an entire new type of functionality, which also blends very well with newer and existing tagging/prefill type features. The preceding changes were started with a more basic MP3 tag update, which added tags that are same in id3v2.3 and id3v2.4 and have FLAC equivalents. Also used this as an excuse to also review and add some Vorbis tags that make sense for acxi to include in auto.tag and tagging/prefill features. Also went through many features, documentation, etc, fixed logic errors, inconsistent logic/docs errors, and added more public documention. -------------------------------------------------------------------------------- SPECIAL THANKS: 1. Once again, to the people who helped make free / libre audio possible, and in particular, the people who worked so hard for so long at xiph.org to provide the world with the codecs and tools we now use to listen to and work on audio. 2. To fourtysixandtwo, the acxi packager for Slackware (slackbuilds). The new --taglist option was his suggestion. This is turning out to be really good and useful already, since it allows for easy bulk testing of entire sets of recordings at once, which acxi can then be used to correct. -------------------------------------------------------------------------------- KNOWN ISSUES: 1. SYNC: Because MP3 tagging changed too much between versions, only id3v2.3/id3v2.4 tags that are the same between versions AND have Vorbis equivalents are supported. Good tag FLAC > MP3 id3v2.x mapping resources: https://wiki.hydrogenaud.io/index.php?title=Tag_Mapping https://docs.mp3tag.de/mapping/ https://docs.mp3tag.de/mapping-table/ 2. AUTOTAG: The tag SUBTITLE in Vorbis/FLAC is super specific, and should be avoided. https://web.archive.org/web/20120429102447/http://reallylongword.org/\ vorbiscomment/ "SUBTITLE: This field is intended for use with FLAC, in order to connect specific titles with an embedded cue sheet. A single file can effectively contain multiple works, indexed by TRACK and INDEX in the case of cue sheets, and they can be specified using subscripts like “SUBTITLE[TRACK 3]” or “SUBTITLE[TRACK 7:INDEX 2]”. This should only be used for the case of multiple works in the same file and not for cases where a single work has multiple titles." 3. TAGLIST: With certain Vorbis tags when output to Perl, that contain cp-1252 windows characters, Perl simply crashes, or appears to be crashing, when those get output to screen. This happens currently only with -L [acfi], and basically, the crash happens when the data is being printed out. You can still find which track it was to manually correct the tags with acxi, but as far as I know, there is no way to trap this error and handle it more elegantly since it either just hangs, or crashes, depending on whether print to screen or Dumper print to screen. Dumper just crashes when it hits that string. -------------------------------------------------------------------------------- BUGS: 1. TAG: In --tag, it was changing directory to SOURCE_DIRECTORY, but failed to remove that from the file string, so tag updates failed unless you were using -s ./. I hadn't noticed that because I almost always use -s./ with -T. This led to things like --glob failing too, since it was never working from the right directory in terms of the path/filename metaflac received. 2. OPTIONS: --nlink would never have worked because it was missing the 'n' ('link'). 3. INFOFIX: Bug with date fix, was always showing true for test for dd-mm-yyyy type, which could lead to failure to then update those dates. -------------------------------------------------------------------------------- FIXES: 1a. SYNC: For mp3 tagging, was using DATE, didn't check for YEAR, but mp3 is very likely to fail if you put a date in that value. Now checks for YEAR first, and falls back to using year (YYYY) extracted from DATE. Note that DATE is supported somewhat, but syntax differs between: DATE: Vorbis: DATE id3v2.3: TDAT; id3v2.4: TXXX:DATE or RECORDING DATE: Vorbis: DATE: id3v2.2: TYE+TDA(+TIM) id3v2.3: TYER+TDAT(+TIME[22]) id3v2.4: TDRC Docs don't agree, so not using DATE in mp3 except to extract year. Note that --ty handles the year so we don't need to worry about what the literal syntax is. I don't want to get into detecting idv2 subversion, this is a messy non-free codec and it shows by how poorly they did tagging version to version, as well as how focused on corporate interests their efforts were. 1b. SYNC: sync was not showing cmd message for --dry, but also was poor code, repeated, switched to use --dbg 5 command debugger or in --dry mode, to show command with --dbg 5, or the simple tool command with --dry. Previously didn't show anything, just 'Would have run:'. That was an oversight, must have messed that test mode up a long time ago. But now works much better because you can either see simple mode, or full command debugging mode, which integrates that to the new $dbg[5] command debugger globally. 1c. SYNC: Never showed that mkdir and copy file were running in test mode, now shows Test mode: for all 3 syncing actions if verbosity > 0. 2. PREFILL: Some of the prefill field names didn't fully match the listed possible values. Also made all 2 word type field names support space, -, _, or no space. 3. TAGLIST/SYNC: Added --no-utf8-convert to main::get_flac_tags(), this is for all types, mp3, replaygain, and full tag lists. 4. INFOFIX: Was missing a date variant: dd-month-yyyy 5. SYNC/AUTOTAG/TAGLIST: Flac tag reader wasn't escaping file name, which led to name with $ failing. Also, the mp3 tag string generator was passing the file name in double quotes, which meant that the $ string was being treated as a scalar and would have been empty as well. Or maybe caused perl to exit with error since non declared variable was being attempted. 6. AUTOTAG/PREFILL: Removed ISRC tag from main body of auto.tag, that is a per track always file, it is a unique idenitifier (or idenfiers in rare cases, like musicbrainz) per file. I had always thought it was a per recording, not track, id, but that is wrong. 7. IMAGES: -RI to trigger --image-remove has not worked in a long time, that's now corrected so -I accepts no value with -RI, -I remove, -I image, or -RI image as originally intended. 8a. OUTPUT: Added $line_small when no info.txt file found for --infofix, forgot that. 8b. OUTPUT: Made $line_small more consistent across -Z, -X, and -L to separate directory processing items. -------------------------------------------------------------------------------- ENHANCEMENTS: 1. TAGLIST: New features: --taglist/-L. Depending on switches, can generate full report of all tags per FLAC file in directory, a condensed version of those tags, or data for creating an info.txt file. As with -X, w writes the data to the file(s). * a: switch output file from taglist.tag to auto.tag, and change tag:value separator from '=' to '%:' * c: generates condensed data from flac tags for tag list. For tags that do not occur in every file, adds tags before block of tags that use them, and either replaces them with next value. or if file does not have that tag, UNSETs the tag. * f: generates full taglist data. This is default if no args used. Adds UNIQUE value TAGBLOCK which forces non cascade of tags per file. This is what you want, so don't change that. * i: generates info file data from flac tags for screen/info.txt. * s: skips file exist tests, so will always run in each directory. Not used with 'w'. * w: writes a, c, i, or f data to respective info.txt, taglist.tag, or auto.tag files. i + [cf] can be used together. a activates c by default, unless you specify f. c and f can't be used together. s can't be used with w. In latest testing, -Lc is generating the same set of condensed tags the original files contain, minus some corrected tags, like having 'ALBUM ARTIST' and ALBUMARTIST tags in the same file, or 'TRACKTOTAL' and 'TOTALTRACKS'. This was seen in musicbrainz picard tagging at times. 2. AUTOTAG: AutoTag::process_tags() now handles multiline tag values. Which should be avoided because very few media players support those correctly. But needed since --taglist a/c/f support multiline tag values. 3. AUTOTAG/AUTOTAG-CREATE: Added --unique, which allows setting one time list of tags to use only 1x in the file following that tag in the auto.tag file. This can be used with -A, -S, -M. This will add that list of single use tags to an existing auto.tag file with -A. Adds that set of tags to the per track tag list, which are handled differently than block type tags, which can apply to > 1 file per set. Only supported for auto.tag creation with -C/-S/-M, or to force the list into the tagging with -A if it was not set in auto.tag already. The TAGBLOCK value tells -A to discard all previously found tags after each file processed. This is only useful with -Lf generated auto.tag files that have complete sets of tags per file. -Lf sets a UNIQUE value TAGBLOCK automatically. -La/-Lc UNSETs tag after last file that used that tag if the previous value is not replaced by a new one and the next file did not contain that tag in the case of multi use of a tag situations, so you don't need to do anything there. 4. AUTOTAG/PREFILL/TAGLIST: Added --autotag-file/--atf/--af for one time changes of auto.tag file name. This was an oversight, but never had cause for it until testing -La exposed the utility of being able to change auto.tag name to something else. 5. AUTOTAG/PREFILL: To auto.tag generator, added CONDUCTOR, MIXER, PUBLISHER, REMIXER, and variants for prefill, like: CONDUCTOR: Conductor, Conducted by. MIXER: Mixed by, Mixer, Mastered by, Masterer. PUBLISHER: Publisher, Label REMIXER: Remixer, remixed by, remasterer, remastered by. 6. AUTOTAG/TAGLIST: Added WORK, SUBTITLE, TITLESORT tags to list of supported tags for tagging, but not to auto.tag because those are made for very specific purposes and are unlikely to be used correctly. See Known Issues 2. Also added a number of track file specific tags like REPLAYGAIN*, ACOUSTID*, etc, to the track tags list for -Lc, -La, and -A. This means that track specific tags that should never be carried over to next file are now protected much better. While hard to get a complete list of tags that must only occur per file, never common between files, very good progress was made to tighten this down. 7. IMAGES: Added --image-remove as synonym for -R, --remove-images 8. SYNC: Significantly expanded MP3 tags. Mapped all acxi tags in auto.tag/--tag that have native mp3 id3v2 tags. Now supported: ALBUM ALBUMARTIST ARTIST ARTISTSORT COMMENT COMPILATION COMPOSER CONDUCTOR COPYRIGHT DATE DESCRIPTION DISKNUMBER DISCSUBTITLE DISKTOTAL GENRE ISRC LABEL MEDIA MOOD MOVEMENTNAME ORGANIZATION PUBLISHER REMIXER SOURCEMEDIA SUBTITLE TITLE TITLESORT TRACKNUMBER TRACKTOTAL YEAR Note that because id3v2.x either doesn't have comparable DATE, LOCATION, OPUS, PERFORMER, PRODUCER, VENUE tags, or v2.3 name is different from v2.4, those tags are not supported. 9. VERSION: Added $self_patch to allow for checking development patch versions, like pinxi uses. Helpful to make sure you have the right version. Also added to --help (and date). This can be helpful during active development. acxi --version acxi version: 3.5.06-14 (2023-01-10) 10a. OPTIONS: Added --glob as alternative to --source-glob/-g. 10b. OPTIONS: Added --config/--configuration, to show you current active configuration values. Shows first to last found, last overrides previous. 11. OUTPUT: Added new print line type: $line_result. This is used to separate result blocks from processing blocks, before was using $line_small for both types. this is used in -X, -L, --config, and -C/-S/-M --dry. See CHANGES 2. -------------------------------------------------------------------------------- CHANGES: 1. CONFIG: Configuration item TAG_FILE has been changed to AUTOTAG_FILE, but TAG_FILE will keep working. This is because we needed non-ambiguous names with new TAGLIST_FILE configuration item. 2. OUTPUT: Changed print line small: ----------------------------------------------------------------- to print line result: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: for blocks of results in --config, -L, -C/-M/-S --dry, -X. This makes it easier to tell the results apart from the processing blocks. 3. AUTOTAG-CREATE: -C, -S, -M should not be allowed to run external to the directory that contains the flac files, that's too risky, so disabled that. I think that was an oversight. 4. DEBUG: Removed --debug, replaced with specific --dbg x(,y) options globally. See CODE 3a, 3b. 5. SYNC: Changed default output type to '', ogg is deprecated, and acxi should not promote it as default. I don't want to assume what people might have been using before. Added $OUTPUT_TYPE set test for sync to force explicit set in config file or with -o. Added --config so people can easily check their configs. -------------------------------------------------------------------------------- DOCUMENTATION: 1a. MAN: Forgot to list AIFF as input type for FLAC output type. 1b. MAN: Added MIXER and REMIXER to --prefill tags. Also cleaned up and made more consistent prefill tag listing. 1c. MAN: Updated man page debugger section for --dbg xx triggers. 1d. MAN: Added more granular man docs for --dbg 1e. MAN: Fixed typo for config file path, had $HOME/.conf/ not .config/. 2. OPTIONS: Updated top part to have better examples with long and short forms. 3a. MAN/OPTIONS: updateed for -R/-I cleanups and corrections, and to make actions/ choices more clear. 3b. MAN/OPTIONS: Updated to add --glob. 4. MAN/OPTIONS/README.txt/: added for new --taglist, --taglist-file, --unique options. 5. AUTOTAG-FILE: Sample auto.tag file, updated to add new tags and comments. 6a. DOCS: Created docs/acxi-values.txt to document internal acxi values. * @dbg - the old --debug was too generic to be useful in real development. * %run, %test, scalar assignments - document internal use of these variables. * verbosity levels, and triggering switches. * configuration items. Always see man for full explanations. 6b. DOCS: Overall, made sure man, help, acxi-values.txt, and internal logic are the same. Surprising number of oddities had crept in, cleaning those up as they get discovered. -------------------------------------------------------------------------------- CODE: 1a. TAG DATA: Refactored flac2mp3_cmd() to make more flexible. Made it return hash ref, not hash. 1b. TAG DATA: Extended main::get_flac_tags() to return 'all' tags in flac file, for new package TagList. Changed old 'standard' to 'flac-mp3', since that was used only to get flac to mp3 tags. Totally rewrote get_flac_tags as well, to be more robust and dynamic. 2. Switched to qw(...) in some tag lists that are being updated frequently. 3a. DEBUG: Added --dbg [x-xx] for granular debugging. Added dbg switch docs in docs/acxi-values.txt. 3b. DEBUG: Changed all previous $b_debug to more granular $dbg[x] tests, and added many commented out say debugging items now that they can be switched off and on in a more granular fashion. 4. OPTIONS: Major refactor of OptionsHandler, which had gotten messy and hard to follow/read/use. Also got rid of the hack I used to turn off features by setting to 0 in each major option item. Now all that is handled in OptionsHandler::set_switches() and OptionsHandler::verify_selections(), and options themselves only switch on $run and $test switches and assign values. 5a. SYNC: Changed to explicit sync switched on only if no other actions conflict in OptionsHandler::set_switches(). This was previously always set to 1, true, on top of acxi by default, now it's only set to true if no conflicting options are used. 5b. SYNC: Refactored SyncCollection::convert_file(), that had a lot of repetetive code, and also switched it to use $dbg[5] show $cmd debugger for both active and --dry mode, or just the tool name/path in --dry mode. See FIX 10. 6. IMAGE: Redid $run{'image-embed'} and $run{'image-remove'} logic, and made more predictable and understandable, which is how the failure had crept in. 7. VALIDATION: Validation had a legacy $b_error in every sub which is redundant since $error_message can be tested t/f in all cases, removed all those. --- acxi | 6 +++--- acxi.1 | 2 +- acxi.changelog | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/acxi b/acxi index 3cc48f3..09cb8aa 100755 --- a/acxi +++ b/acxi @@ -79,9 +79,9 @@ $Data::Dumper::Sortkeys = 1; ## SELF INFO ## my $self_name='acxi'; -my $self_version='3.5.06'; -my $self_patch='31'; -my $self_date='2023-01-22'; +my $self_version='3.6.00'; +my $self_patch='00'; +my $self_date='2023-01-23'; ## GLOBALS ## ## Booleans diff --git a/acxi.1 b/acxi.1 index c5c2a2a..8872a6f 100644 --- a/acxi.1 +++ b/acxi.1 @@ -1,4 +1,4 @@ -.TH ACXI 1 "2023\-01\-20" acxi "acxi manual" +.TH ACXI 1 "2023\-01\-23" acxi "acxi manual" .SH NAME acxi \- Command line audio conversion tool .SH SYNOPSIS diff --git a/acxi.changelog b/acxi.changelog index 31f44ed..f80fc96 100644 --- a/acxi.changelog +++ b/acxi.changelog @@ -1,7 +1,7 @@ ================================================================================ Version: 3.6.00 Patch: 00 -Date: 2023-??-?? +Date: 2023-01-23 -------------------------------------------------------------------------------- RELEASE NOTES: -------------------------------------------------------------------------------- @@ -369,7 +369,7 @@ more predictable and understandable, which is how the failure had crept in. since $error_message can be tested t/f in all cases, removed all those. -------------------------------------------------------------------------------- --- Harald Hope - Fri, 30 Dec 2022 12:57:40 -0800 +-- Harald Hope - Mon, 23 Jan 2023 15:00:00 -0800 ================================================================================ Version: 3.5.06