Hello once again;
With Mp3Tag v3.23 and the fix to json_select_many function, I've been able to include the previous patch into the final script; and I was ready to release that script, but...
As I started experimenting with the tools provided in 3.23, I realized that I was now able to include a feature that I'd been trying to add for a long time - selecting cover art size. That is, the ability to query for album cover art with specific dimensions. This was made possible using the settings schema for Tag Sources introduced in v3.22 plus the tools of v3.23.
I have made a separate topic with the details of how I did it, so that other authors may use/improve this method.
So then, here is the new iTunes WS script -version 3.5. Changes include:
- ADDED: Configuration settings menu
I've reworked the script to use the settings schema for Tag Sources. This adds a menu with more available search criteria to select from; some of these criteria are added features, while other are reworked features from the previous version that are now available as options.
- ADDED: Custom cover art size
It's now possible to select a cover size from a list of presets in the configuration settings menu, and it is also (somewhat) possible to enter a custom size to be queried to the API (preset to 600x600px by default). I say 'somewhat possible' for two reasons, which I will explain with an example below.
- CHANGED: Explicit values moved to Configuration settings menu
Instead of editing the script to enable/disable parsing of explicit/censored values, both options have made available, and can be toggled via a checkbox in the Settings menu (disabled by default).
- CHANGED: Optimized code for new features / tools
Implementing the new features would not be possible without the new tools brought by v3.23, and sometimes that meant an update of existing features. This means that the Settings menu is only available in v3.5 and that the Settings file will be required for the script to work. I am releasing a version of the script that works without a Settings file, but Cover size and Explicit values will be locked in their respective defaults.
- FIXED: Abnormal / incorrect results could be returned under certain conditions
Thanks to Florian for his revised documentation of JSON tools, the previous patch has now been worked into a permanent fix. In the rare event that a censored dataset is incomplete, the script will now try to fill any gaps with uncensored data, or return an empty tag if none is found, preventing the propagation of incorrect results.
Now, let's say we want a cover size of 550x550 pixels. First, going to [Tag Sources] > [iTunes WS] > iTunes WS_settings we'll need to choose the < user-defined > preset for cover size.
Next, we enter the "550" width/height value digit-by-digit using the four provided selection fields, so that "550" becomes 0-5-0-0. Then, submitting the changes and running a search using the script at [Tag Sources] > [iTunes WS] > iTunes WS_settings will return results with the cover art in the most approximate size the API can provide (hence the 'somewhat possible' mentioned before).
In order to work in the possibility of a user-defined number, I had to compromise, and instead of a standard number input field I had to use the 4 selection boxes, which limits the range to a 4-digit number [0000-9999]; also, the API can only return sizes equal or smaller than the largest cover size available for a given album (by scalling down from the original cover), and which maintain the original aspect ratio.
So, querying for a mismatched size like 9876x5432px will not be possible (and would only be interpreted by the API as 9876x9876); and querying for 2000x2000px and getting 1400x1370px (for example) can happen (if such is the biggest cover size available). Within these 2 limitations, any cover size should be possible.
Here are the scripts and settings file for version 3.5; as in earlier versions, I'm releasing a version for US-english, JA-english, JA-japanese, and a clean version without any presets. This last clean version will also be made available standalone (without the need for the Settings file). Use the link below or in the first post.
Enjoy.
iTunes WS#350.zip (14.2 KB)
And Happy Holidays to all.