Greetings to all;
Here is a feature update to my iTunes script with multiple search criteria; version 3.70-stable
This release follows v3.62-stable, and includes all the changes from the beta releases in-between. I'm also rolling out new features\improvements, centered on a better workflow for switching between tag sources.
v366b > v370 change log:
Fixed \ Changed:
- 'Apple Music' mode
[_COLLECTIONADVISORY] tag partially restored
With the recent change to the Apple Music webpage source layout, the data used to fill the ITUNESADVISORY tag is no longer provided; the custom _COLLECTIONADVISORY tag was also constructed from the same data, but I've managed to restore partial functionality from an explicitness flag still present in the raw data. The reworked tag will now show in Album results as ['Explicit' | -absent-], when the previous version had ['Explicit' | 'Clean' | -absent-] values (as 'iTunes mode' does). It does still fulfill its intended purpose, which is to clearly identify when a collection contains one or more explicit tracks.
New:
- Added 4th search box for capping query results per tag source
On some occasions it's useful to have a high number of query results (usually when searching a generic term); whereas on long tagging sessions, having a lower results count is more desirable.
With the addition of the 4th search box, both scenarios are now possible, without having to resort to script modding. iTunes API allows defining a search limit in the [1-200] integer range; I've set the query field's default value to [50] to match the API's, so in most use cases there will be little need to change this (but now you can). Integers outside this range (and other invalid values) are considered invalid by the API, and normally ignored.
- Added current language code to 'Source' column and
#_SOURCE
The language setting used in the initial search is now displayed both in the 'Source' column in Query results, and in the custom #_SOURCE tag in Album results, as an appended '| en' or '| ja' string to the current tag source. I have yet to find an example to test the 'ja_jp' language code, but it should display as well as with 'en_us'.
- Added custom tag
LABEL to 'Apple Music' mode
Some Apple Music album pages have 'Record Label' information added (usually below 'Copyright'). If provided in the source data, that information will now be displayed in a custom tag in Album results. I've found during research that, while the ID3 standard has the PUBLISHER tag (and many times a Publisher and Record Label companies share the same name), PUBLISHER and LABEL are not the same, and therefore a custom label was the solution found to display this data while being ID3 safe (or trying to
).
- Added new setting option: 'Tag data source' ->
< multiple >
The main new feature of this release. Previous selection of a tag source -between Apple Music and iTunes- so that one or the other data sources can be searched from a single script was already possible as a setting; but for quite some time I had been researching for a way to change sources during a search process, i.e. being able to swap between iTunes API mode and Apple Music Web mode without having to finalize a search (by submitting\cancelling), going to script Settings, changing the option, and starting a new search. Originally this was to serve my own troubleshooting purposes, because I needed a more direct way to compare results between modes, only to realize that others could also find themselves in a similar situation. It may seem simple, but fulfilling this took many development roads, and several builds to get to the current version.
As with the other values for this option, toggling 'Tag data source' to <multiple> will change how initial query results are returned; in this mode, results for 'iTunes API' mode and 'Apple Music Web' mode will both be made available as a 'set' for each album entry returned from iTunes query source: the first parsed line of each set will always be the 'iTunes API' one, followed by the 'Apple Music Web' one. When in Album properties, getting to the results of the other source of the same set is now as simple as going back once and selecting it.
I had mentioned before on a previous post, but Mp3Tag was never designed to handle a multiple source script; so in order to help tell apart which line refers to which mode, the 'Source' column in Query results will display the tag source name (it already did, and maybe it was originally added with this eventual purpose in mind
); also, 'Apple Music Web' lines will never show thumbnails in this mode (with preview thumbnails enabled).
This serves a few purposes: with thumbnails on, there will be half as many images for Mp3Tag to process (which would be duplicates anyway, and therefore redundant), meaning faster results and a less cluttered query list; and using the "iTunes w/ image | Apple w/o image*" rule of thumb, the desired source can be picked from the list at a glance (which is helpful on a large query results' list).
With thumbnails disabled, you can still tell each set apart by the contents of the 'Album' column and/or the unique number of the 'Catalog ID' column for each set (which also maybe was originally added for this eventual purpose
). The 'Source' column -again- tells each entry of a set apart; and when sorting, these 2-3 columns can be used to change the order of entries in each set (while maintaining the sequence of sets), and\or restore the list to a proper order in case of a misclick, so the results' list can be arranged in the order that best suits your current need.
This operation mode has the downside of not being able to have Album results directly shown when using a Catalog ID as a search term (because any query result will always generate twice the query list entries), which is why the 'Tag mode' in Settings keeps previous 'iTunes API' and 'Apple Music Web' options, which enable direct Album results.
I'm keeping support for these options for now, but I'm also considering removing them in the future, as having multiple tag source query results seems the best path to steer future development of my script.
After the review of the [ParserScriptIndex] script (responsible for query processing) to accommodate the new feature(s), I made additional tweaks to improve overall efficiency. The revised script only has an additional 3 lines from the previous stable version (including whitespaces \ disabled code) and, due to a new parsing workflow, generates a debug file ~40% smaller (in <multiple> mode) when compared with v3.62. Which is good news when considering now there are twice as many list entries for the same query results (I use debug file size to scale how efficiently my scripts run, where -while not accurate- smaller size usually means better/faster script).
With this new release comes a new .settings file (with the above-mentioned new tag source option). As each main version of my script is built upon the previous, older .src and .settings files should -unless stated otherwise- be removed.
This is of particular importance for .settings files, because -for example- if the scripts for both v3.62 and v3.70 were in the same \sources folder, modifying a setting for v3.62 will also modify its counterpart in v3.70, and vice-versa.
From what I've learned, modified script settings are saved as key-value pairs, and while a .settings file is linked to a .src file to prevent contamination, keys are not; so if a .settings file shares keys with another, and the 2nd file is linked to a script, changing a setting in the 1st file can modify that script, even if not directly linked to it.
The best advice I can give to prevent this is to remove older and unnecessary files from the 'sources' folder, and only keep the most up-to-date versions.
So then, here is the new iTunes WS script with multiple search criteria, version 3.70 -stable.
Please use the link below; and I'll update the first post with this version after a kind macOS user validates it for that system.
iTunes WS#370.zip (5.1 KB)
And as always, enjoy your tagging. 