Welcome Guest

Pages: 1
Action to fetch folder.jpgs online
arceePostJune 10, 2017, 16:44
Newbie
Posts: 2
Registered:
June 10, 2017, 19:43
Normal topicAction to fetch folder.jpgs online

Yate is a gem and I'm very happy I bought a license. After a few weeks of use, I'm now digging into actions. The learning curve for a non-programmer (I did BASIC back when VIC-20s roamed the earth) is a bit tricky, but I'm getting somewhere.

First, my use case: my 2tb library served by Jriver Media Center needs artwork. When I digitized it ages ago, I didn't know a tag from a tab. To make matters worse, one day I stopped using iTunes without having a good plan for migrating cover art. So here I am.

Everything's in an Artist/Album folder hierarchy, fortunately. And nearly all files have artist and album tags. Maybe a third or more is missing art.

I don't want to retag every audio file. Luckily, JRiver doesn't care whether art is embedded in an audio file or resides in a folder. Main reason is time-savings: backing up huge drives is slow. Much faster if I just have to set DeltaWalker loose on updating one-per-folder artwork files across multiple drives.

Here's what I've figured out by copying and studying bits of actions from your forum posts. Running in batch mode, I have a simple action to test the first audio file in each folder for embedded art using the Constrain statement. It works. If it finds nothing, I want it to call your Count Artwork Files in Folders to build a log showing me all those folders that have no art at all (neither embedded nor image). Sound sensible? I'm not sure how best to make the former call the latter, though.

What would be ideal, hopefully not farfetched, is if at the end this process Yate could hand off functionality to your Artwork Search and Save Artwork to Folder.jpg functions. Then Yate could populate "no art at all" folders automatically without touching the audio files. I don't mind it running hands-off: I could later inspect the results in JRiver, and make corrections there as need be.

Does this sound at all doable? Thanks for your help!

2MR2PostJune 10, 2017, 18:08
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Action to fetch folder.jpgs online

I've uploaded a sample action designed to be run under the Batch Processor. If none of the audio files contains artwork and the folder does not contain a folder.jpg file, it will look for artwork. If found, the artwork item will be saved to folder.jpg. A message will be placed in the log file for any folder which did not contain artwork and will indicate success or failure in the match.

If the Album metadata was not consistent or if any track had an empty Album field, the Album will be extracted from the containing folder.

If the Artist metadata was not consistent or if any track had and empty Artist field, the Artist will be extracted from the parent folder.

No changes will be made to any of the audio files.

I'm only looking for folder.jpg. If you want to change this to 'any image file', I will have to make changes.

The country code for the artwork search was set to US. If this is not what you want, change the Auto Search for Artwork statement on line 25. (You can enable the display of line numbers via the context menu in the Action Editor window).

Download and unzip: https://2manyrobots.com/actions/ConditionalLookForArtwork.zip

Unzip the file and via Yate>Import Preferences select the unzipped "Conditionally look for artwork, saving to folder.plist" file.

Start the Batch Processor from the Actions menu.
Select the "Conditionally look for artwork, saving to folder" action
Hit Next
Drag over the root or part of your folder structure. (I recommend trying it first on a subset).
Hit Next
You can leave the Auto-Save and Verbose options unchecked. (nothing is saved to the files)
Hit Start

That should do it. If you want it to look for any image file as opposed to only folder.jpg, let me know.

arceePostJune 10, 2017, 19:45
Newbie
Posts: 2
Registered:
June 10, 2017, 19:43
Normal topicRe: Action to fetch folder.jpgs online

Firstly, thanks a million! I hardly expected a reply let alone a complete set of code on the same day.

Yes, I should have indicated "look for any image file." Such art as exists now is all over the map in naming conventions. What I have in mind is your search for "jpg,jpeg,png" variations as found in your original Count Artwork action. If you can change this, I'm grateful.

Totally blown away, thanks again.

2MR2PostJune 10, 2017, 23:21
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Action to fetch folder.jpgs online

np. I've adjusted the action to exit on the presence of an .jpg, .jpeg or .png file.

Download https://2manyrobots.com/ConditionallookForArtwork2.zip

After importing the unzipped plist file you will have "Conditionally look for artwork, saving to folder.jpg 2".

The adjusted steps are:

Start the Batch Processor from the Actions menu.
Select the "Conditionally look for artwork, saving to folder 2" action
Hit Next
Drag over the root or part of your folder structure. (I recommend trying it first on a subset).
Hit Next
You can leave the Auto-Save and Verbose options unchecked. (nothing is saved to the files)
Hit Start

This should do it 🙂

2MR2PostJune 10, 2017, 23:23
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Action to fetch folder.jpgs online

Oops. Sorry, the correct link is:

https://2manyrobots.com/actions/ConditionallookForArtwork2.zip

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.019 seconds.