Action for adding album art automatically


#1

I recently learned a little bit on changing filenames with mp3tag, to get iTunes formated filenames.

Now I would like to see if I could make an action for adding album art automatically as well.

Why would I like to do this?
Well you see I have over 6000 albums, all with different album art dimensions. Doing it automatically would minimize both time and hdd writing.

Let me explain how I organize my album art:
Every album has it's own folder. In every folder there can be up to 3 different sizes.
My standard dimensions are 600px, 800px and 1000px. The 1000px is not used at the moment, it's just there for future use.

I name all my album art by this filename scheme:

album-art-600px.jpg
album-art-800px.jpg
album-art-1000px.jpg

if not available in 600px I instead have one of the following:

album-art-500px.jpg
album-art-400px.jpg
album-art-300px.jpg

So now let's get to it. The action I want to do is: If there is a album-art-800px.jpg available the action should change the album art to that one, if not it should choose album-art-600px.jpg. If however there isn't even a album-art-600px.jpg available it should choose either album-art-500px.jpg, album-art-400px.jpg or lastly album-art-300px.jpg

Can anyone point me into the right direction?


#2
Begin Action Group Test_2011#20110422.jimpalompa.AddCover

Action #1
Actiontype 12: Import cover image from file
Formatstring for image filename: album-art-300px.jpg

[X] Delete existing cover image

Action #2
Actiontype 12: Import cover image from file
Formatstring for image filename: album-art-400px.jpg

[X] Delete existing cover image

Action #3
Actiontype 12: Import cover image from file
Formatstring for image filename: album-art-500px.jpg

[X] Delete existing cover image

Action #4
Actiontype 12: Import cover image from file
Formatstring for image filename: album-art-600px.jpg

[X] Delete existing cover image

Action #5
Actiontype 12: Import cover image from file
Formatstring for image filename: album-art-800px.jpg

[X] Delete existing cover image

End Action Group Test_2011#20110422.jimpalompa.AddCover (5 Actions)

DD.20110422.1752.CEST


#3

Won't that affect the hdd writing, writing each album art if available, just to write and replace another one again?

I would also like to not get any error dialog right after the action is done, which this action does.

Is it not possible to use some sort of script for this action instead?

Thanks for the quick input!


#4

This cover import action does not yield an error or warning message, when a file is not found.
It simply says nothing, even when a picture image has been imported.

DD.20110422.1815.CEST


#5

But it gives me a dialog:

Import cover from file "album-art-300px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-300px.jpg cannot be accessed.
Import cover from file "album-art-400px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-400px.jpg cannot be accessed.
Import cover from file "album-art-500px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-500px.jpg cannot be accessed.
Import cover from file "album-art-800px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-800px.jpg cannot be accessed.
Import cover from file "album-art-300px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-300px.jpg cannot be accessed.
Import cover from file "album-art-400px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-400px.jpg cannot be accessed.
Import cover from file "album-art-500px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-500px.jpg cannot be accessed.
Import cover from file "album-art-800px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-800px.jpg cannot be accessed.
Import cover from file "album-art-300px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-300px.jpg cannot be accessed.
Import cover from file "album-art-400px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-400px.jpg cannot be accessed.
Import cover from file "album-art-500px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-500px.jpg cannot be accessed.
Import cover from file "album-art-800px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-800px.jpg cannot be accessed.
Import cover from file "album-art-300px.jpg": File D:\iTunes Media\Music_NSYNC_NSYNC\album-art-300px.jpg cannot be accessed.

etc.


#6

Those error messages might have a different cause.
Maybe a wrong path, perhaps no authorized to access or otherwise.
Maybe switch off:
Mp3tag/Tools/Options/Messages/At warnings from actions.

DD.20110422.1830.CEST


#7

Will the action not affect the hdd writing, in example if there is both album-art-600px.jpg and album-art-800px.jpg, will the action first write the 600px, then write the 800px and delete the old one?

Or will it just skip writing the 600px since there is 800px available?


#8

The answer to this question is one of the mysteries of Mp3tag.
Who cares?
It is the only way to reach your goal.

DD.20110422.1855.CEST


#9

Well I was just wondering. When you're processing over 110000 files you like to minimize the writing.

I just thought there was a way to have some sort of script, like I did with the iTunes filename thing.


#10

If you could name a function, which will do something like 'If there is a album-art-800px.jpg available', then there would be the chance to do some nested $if() or $if2() construct.

And ... if you care about the large number of image files to process, then you have to organize your work differently. Simply touch less files.
Copy all the best sized images to a file with the same name. So you don't have the need to decide what image file version to fetch and additionally you can save many action calls.

DD.20110422.1944.CEST


#11

Or try a little different approach:

First run only an action to import the album-art-800px.jpg images.
After that use the filter [F3] to hide all files that got the 800px covers. Use this filter string:
%_covers% IS ""

Now import only 600px images. After that refresh the file view [F5] so the files with the 600px covers also disappear.

Repeat till finished.