Page 1 of 1

Script Help - Editing Album Art

Posted: Tue Apr 01, 2008 12:05 am
by fenrir
How do i access the Cover ?

Code: Select all

   	
With SDB.Player.CurrentSong
        .Covers = GetImageFromClipboard
        .UpdateDB
        .WriteTags
End With
.Covers = GetImageFromClipboard //// .Covers is wrong here.. any idea what it should be?

I'm trying to write the current image on the clipboard to the song's album art

Posted: Tue Apr 01, 2008 12:15 am
by fenrir
Nevermind. Got it

.AlbumArt

Posted: Tue Apr 01, 2008 3:21 am
by trixmoto
Yeah, AlbumArt is what you're after. :)

Posted: Tue Apr 01, 2008 3:43 am
by fenrir
Umm.. another help..
SDBAlbumArtItem does not allow to set an Image property..

Any idea how to add an art to the AlbumArt tag?

I would rather not create an image at the temp location and then add it via PicturePath, as far as possible ie.

Posted: Tue Apr 01, 2008 6:21 am
by trixmoto
I think you need to have a physical file, unfortunately. Personally I've found this method best...

Code: Select all

Set img = itm.AlbumArt.AddNew            
img.RelativePicturePath = relpath(newpath,itm.Path)
img.ItemType = 3
img.ItemStorage = 0
Where "relpath" is...

Code: Select all

Function relpath(relp,path)
  relpath = relp
  Dim temp : temp = Left(path,InStrRev(path,"\"))
 
  'check same folder
  If InStr(relp,temp) = 1 Then
    relpath = Mid(relp,Len(temp)+1)
    Exit Function
  End If
 
  'check parent folders
  If Left(temp,2) = "\\" Then
    temp = Mid(temp,3)
  End If
  If Left(relp,2) = "\\" Then
    relp = Mid(relp,3)
  End If
  Dim tp : tp = Left(temp,InStr(temp,"\"))
  Dim tr : tr = Left(relp,InStr(relp,"\"))
  If (UCase(tp) = UCase(tr)) Then
    While (UCase(tp) = UCase(tr))
      temp = Mid(temp,Len(tp)+1)
      relp = Mid(relp,Len(tr)+1)
      tp = Left(temp,InStr(temp,"\"))
      tr = Left(relp,InStr(relp,"\"))
    WEnd
    relpath = ""
    While (InStr(temp,"\") > 0)
      relpath = relpath&"..\"
      temp = Mid(temp,Len(tp)+1)
      tp = Left(temp,InStr(temp,"\"))
    WEnd
    relpath = relpath&relp
  End If
End Function

Posted: Tue Apr 01, 2008 6:30 am
by fenrir
thank u so much..

i'd give it a go..
Basically modifying WebSearch Panels script to add more buttons other than the default Lyrics & Comment button.

Thinking of adding a button for as many Tags as possible. Have all of them working (with the clean up text) except for the AlbumArt part.

Hope jn does not mind

Posted: Tue Apr 01, 2008 6:35 am
by trixmoto
Sounds like a good idea - I'm sure he won't mind as long as you mention the fact that it's a modification of his script. Maybe send him a PM first to see what he thinks. :)