Album Art Tagger 5.1 - Updated 23/10/2012

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Postby trixmoto » Mon Dec 11, 2006 5:36 am

I'm glad you like the script! :D
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby wolfzell » Mon Dec 11, 2006 7:21 am

Hello trixmoto,

I just finished the task of scanning my 993 CD covers. I could only work on weekends and only when my family gave me the time, so it took me about 8 weeks. My wife says if I will touch all those CDs once more, she will be leaving... =6^)

Now I wanted to use your nice script to embed the art into my tags.

But since I am using the mask <artist> - <album>, sometimes I have problems as your script does not exchange several special characters.

Now to copy MMs behavior when renaming filenames, I changed a function of your script a little.

Maybe you want to adopt the change, it is rather useful. Here it is:

Code: Select all
Function puttrackart(itm,boo)
  Dim upd : upd = False
  Dim first : first = True
  Dim path : path = FileMask
  path = Replace(path,"<path>",Mid(itm.Path,1,InStrRev(itm.Path,"\")-1))
  If (itm.AlbumArtistName = "") Then
    path = Replace(path,"<artist>",itm.ArtistName)
  Else
    path = Replace(path,"<artist>",itm.AlbumArtistName)
  End If
  If (itm.AlbumName = "") Then
    path = Replace(path,"<album>",itm.Title)
  Else
    path = Replace(path,"<album>",itm.AlbumName)
  End If
  Dim name : name = Mid(itm.Path,InStrRev(itm.Path,"\"))
  name = Mid(name,2,InStrRev(name,".")-2)
  path = Replace(path,"<file>",name)
  path = Replace(path,"<#>",Progress.Value+1)
  path = Replace(path,"?","")
  path = Replace(path,"!","")
  path = Left(path,2)+ Replace(path,":","-",3)
  path = Replace(path,"/","-")
  path = Replace(path,"""","'")


Thanx once more for your wonderful scripts. They make using MM even more fun.

bye
Wolfgang
wolfzell
 
Posts: 155
Joined: Fri Apr 23, 2004 8:42 am
Location: Germany

Postby trixmoto » Mon Dec 11, 2006 8:02 am

It is on my to do list to correct the image filename using the standard MM call, this will mean it will work whatever your character replacement settings are.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Error

Postby Joeshmoe » Tue Dec 12, 2006 6:17 am

When I try to extract art from tags to folder.jpg

I get " error # 424 microsoft vbscript runtime error
object required 'out"
file .... albumarttagger.vbs, line 594, column 14"
after click OK
"object required 'out"

Seems like it worked before. Hmmm. Tried to reinstall with same results.

thanks for all the great scripts trixmoto
Joeshmoe
 

Postby trixmoto » Tue Dec 12, 2006 7:57 am

If you open the script file in a text editor, lines 593-594 should be...
Code: Select all
Set out = SDB.Tools.FileSystem.CreateTextFile(gettrackart,True)
out.WriteData jpg.ImageData,jpg.ImageDataLen

Please insert the following line between them, to give you...
Code: Select all
Set out = SDB.Tools.FileSystem.CreateTextFile(gettrackart,True)
If out Is Nothing Then MsgBox gettrackart             
out.WriteData jpg.ImageData,jpg.ImageDataLen

Then when you run the script you should get a filename put up in a message, what is the filename?
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby joeshmoe » Tue Dec 12, 2006 6:54 pm

folder.jpg
joeshmoe
 

Postby trixmoto » Wed Dec 13, 2006 4:37 am

Well that's the problem then, you haven't specified a path! If you want the image to appear in the album folder then you mask should be "<path>\folder.jpg", otherwise you need to specify a common folder in the mask itself.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby joeshmoe » Wed Dec 13, 2006 6:51 pm

my mask is <path>\folder
Says it will create folder.jpg in the correct folder but then the error occurs.
joeshmoe
 

Postby birk » Thu Dec 14, 2006 6:26 pm

Well this script is really what I have been looking for. Is there some way other than manual that the produced images I want are set as hidden so they don't show? :)
birk
 

Postby trixmoto » Mon Dec 18, 2006 5:07 am

I'm not sure why you'd want to do this, but I've put it on my to do list for the next version.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby capncappie » Mon Dec 25, 2006 1:28 am

Whew! has this script helped me clean things up! Thanks!

Any chance of adding the ItemType to image filename mask options?
I have many albums with front_cover, back_cover, etc.
Ideally I'd like to save that info when extracting, and be able to restore/add it when tagging (while keeping track of the tag order too, of course).

I currently have an inelegant system of folder.jpg, back.jpg, cover2.jpg, pg1.jpg, etc

I can see alot of room for trouble trying to implement this with <album> but I'd be happy using a fixed name like "folder" and something like a trailing -nn

e.g.:
folder.jpg = first art, front cover (item type not present- defaults to type3)

folder_2-4.jpg = second art, back cover

folder_3.jpg = third art, front cover

folder_4-3.jpg = 4th art, yet another front cover

etc

anyway - I don't know if there's enough interest in the idea ...
capncappie
 

Postby Guest » Thu Dec 28, 2006 11:31 am

Continuing from my earlier post ...

I had a chance to mull it over some more and look at your script and came up with a couple of ideas:

1) Give the choice of extracting all or just the first piece of art - use the <*> mask - currently ignored on extract.

Added to Function gettrackart:

Code: Select all
  Dim picscount
  If InStr(FileMask,"<*>")>0 Then
    picscount = pics.Count-1
  Else
    picscount=0
  End If


and changed the For:

Code: Select all
  For i = 0 To picscount



2) Tracking image type:
I finally concluded it makes the most sense to append the image type as a suffix after the image number suffix. Also that the first/only image should be considered a front_cover (unless specifically typed otherwise) and thus doesn't need a type suffix. This preserves your current number system and compatibility with "folder.jpg" art.

So - adding a mask option of <type> and a function SpellType to convert types from numbers to words and back --

Extracting the image type to the image file name:

Changed the deepest If in Function gettrackart which completes the file name:

Code: Select all
        If InStr(gettrackart,"<type>") > 0 Then
            gettrackart = Replace(gettrackart,"<type>","")
              If (i = 0) and (pics.Item(i).ItemType=0 or pics.Item(i).ItemType=3) Then
                gettrackart = gettrackart&".jpg"
              Else
                gettrackart = gettrackart&"_"&(i+1)&"-"&SpellType(pics.Item(i).ItemType,True,False)&".jpg"
              End If
        Else
          If (i = 0) Then
            gettrackart = gettrackart&".jpg"
          Else
            gettrackart = gettrackart&"_"&(i+1)&".jpg"
          End If
        End If



Embedding/linking art:

Added to Function Puttrackart:

Code: Select all
  Dim puttype : puttype = False
  If InStr(path,"<type>") > 0 Then
    path = Replace(path,"<type>","")
    puttype = True
  End If


And changed "img.ItemType = 3" and "img2.ItemType = 3" to:

Code: Select all
            If puttype and InStrRev(puttrackart,"-")>0 Then
              img.ItemType = SpellType(Mid(puttrackart,InStrRev(puttrackart,"-")+1,InStrRev(puttrackart,".")-InStrRev(puttrackart,"-")-1),False,first)
            Else
              img.ItemType=SpellType("",False,first)
            End If
            first = False



Code: Select all
            If puttype and InStrRev(puttrackart,"-")>0 Then
              img2.ItemType = SpellType(Mid(puttrackart,InStrRev(puttrackart,"-")+1,InStrRev(puttrackart,".")-InStrRev(puttrackart,"-")-1),False,first)
            Else
              img2.ItemType=SpellType("",False,first)
            End If
            first = False




Finally, the SpellType function which hard codes stuff that really ought to be in the ini file 'cause

I just did it to my taste, needs, & language:

Code: Select all
Function SpellType(imgtype,boo,boo1st)
  If boo Then
    Select Case imgtype
      Case 3
        SpellType="Front"
      Case 4
        SpellType="Back"
      Case 5
        SpellType="Inside"
      Case 6
        SpellType="CD"
      Case Else
        SpellType=imgtype
    End Select
  Else
    Select Case LCase(imgtype)
      Case "front"
        SpellType=3
      Case "back"
        SpellType=4
      Case "inside"
        SpellType=5
      Case "cd"
        SpellType=6
      Case Else
        If InStr(LCase(imgtype),"cover")>0 Then
          SpellType=3
        Else
          If InStr(LCase(imgtype),"page")>0 or InStr(LCase(imgtype),"pg")>0 Then
            SpellType=5
          Else
            If InStr(LCase(imgtype),"label")>0 Then
              SpellType=6
            Else
              If boo1st Then
                SpellType=3
              Else
                SpellType=0
              End If
            End If
          End If
        End If
    End Select
  End If
End Function


If these ideas are of general interest maybe they could make it into your next release ... thanks again for a wonderfully useful script.
Guest
 

Postby trixmoto » Tue Jan 02, 2007 4:54 am

I will have a look at these suggestions and see about implementing them in the next version. Thanks for taking the time to think about these issues.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby juggernott » Sat Jan 06, 2007 10:37 pm

I am getting an error nearly every single time I run the script (attached below). It can handle most of my files but it really pops up with this a lot. Once this error comes up, the script no longer runs. It comes up only when I tell it to save the files.

Any idea on what's going wrong?

Image
juggernott
 
Posts: 4
Joined: Sat Jan 06, 2007 1:27 am

Postby trixmoto » Sun Jan 07, 2007 12:34 pm

@juggernott - this is posted in the wrong thread!
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

PreviousNext

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 10 guests