Need help with script - editing album art

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Need help with script - editing album art

Re: Need help with script - editing album art

by Peke » Sun Nov 30, 2014 7:13 am

From what I see here is what you need to change, I left it commented just in case.

Code: Select all

    Sub QuickTrackMod
       Dim currentSongList, song, i
       
       On Error Resume Next
       
       Set currentSongList = SDB.CurrentSongList
       For i=0 To currentSongList.Count-1
          Set song = currentSongList.Item(i)
          
          'Commented out because calling 'Delete' does not seem to alter the AlbumArt collection here, even after calling UpdateAll. Yay infinite loops...
          'Do While song.AlbumArt.Count > 0
             'MsgBox "Deleting..."
             'song.AlbumArt.Delete(0)
             'song.AlbumArt.UpdateDB
             'SDB.ProcessMessages
          'Loop
          
          Set newArt = song.AlbumArt.AddNew
          newArt.PicturePath = "D:\Music\My Music\Album Art\[album art file here].jpg"
          newArt.Description = "Album Art"
          newArt.ItemType = 3
          newArt.ItemStorage = 0
       Next
       
       currentSongList.UpdateAll
       SDB.ProcessMessages
       MsgBox "Done"
    End Sub

Re: Need help with script - editing album art

by rovingcowboy » Sun Nov 30, 2014 3:15 am

mediamonkey has to have all the tracks selected to change them all. just selecting one track will only change that one track.

select several songs like all one album then right click on them and click on properties. you will see a check box is now beside all the tag's fields on the properties panels that is for checking what data you want copied to all the selected songs.

you will of course never want to check the one beside the title if it is still there. as that will make all the songs the same title.

but check that out and see how it is done then you might be able to get your script to auto check the needed tag fields of only the selected album. but I think your going to have to do it in that way to achieve what you want. 8)

Need help with script - editing album art

by raiden63 » Fri Nov 28, 2014 11:50 pm

As part of an auto-organize workflow script I am writing, I am trying to automatically re-tag the album art of all the tracks in a given album. The tracks are all FLAC format; I'm not sure if that's a problem for MM, since I'm given to understand that the tag standard is different from, say, MP3.

In the sample script below, I am using the CurrentSongList collection. My problem is that even with all the tracks I want to overwrite selected (Ctrl+A), the track that was selected via mouse click is the only one whose album art is overwritten. Not sure why this is happening?

Code: Select all

Sub QuickTrackMod
	Dim currentSongList, song, i
	
	On Error Resume Next
	
	Set currentSongList = SDB.CurrentSongList
	For i=0 To currentSongList.Count-1
		Set song = currentSongList.Item(i)
		
		'Commented out because calling 'Delete' does not seem to alter the AlbumArt collection here, even after calling UpdateAll. Yay infinite loops...
		'Do While song.AlbumArt.Count > 0
			'MsgBox "Deleting..."
			'song.AlbumArt.Delete(0)
		'Loop
		
		Set newArt = song.AlbumArt.AddNew
		newArt.PicturePath = "D:\Music\My Music\Album Art\[album art file here].jpg"
		newArt.Description = "Album Art"
		newArt.ItemType = 3
		newArt.ItemStorage = 0
	Next
	
	currentSongList.UpdateAll
	MsgBox "Done"
End Sub
MediaMonkey Gold version 4.1.5.1719

Top