Adding Genres to Song with VBScript

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderators: Gurus, Addon Administrators

skj88
Posts: 17
Joined: Sat Jul 02, 2011 10:44 am

Adding Genres to Song with VBScript

Post by skj88 »

I am trying this code as a test to build a script to do some mass updates in MM for me. The new Genre shows in MM on the song I want it to show on, but when I update the library, the Genre tag is reset to the previous Genre(s). Your help is greatly appreciated!!

Sub TestAddGenre()
Dim SDB, Iter, objSong
Set SDB = CreateObject("SongsDB.SDBApplication")
SDB.ShutdownAfterDisconnect = False
Set Iter = SDB.Database.QuerySongs("AND Songs.ID=7522")
Set objSong = Iter.Item
objSong.Genre = "MyGenre"
objSong.Updatedb
objSong.writetags
Set objSong = Nothing
Set Iter = Nothing
Set SDB = Nothing
End Sub

Steve
Last edited by Lowlander on Thu Oct 13, 2011 10:25 am, edited 1 time in total.
Reason: Moved to correct sub-forum
Eyal
Posts: 3114
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Adding Genres to Song with VBScript

Post by Eyal »

I tried it on one song and it's working fine. When I re-scan the folder, the genre does not change.
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
skj88
Posts: 17
Joined: Sat Jul 02, 2011 10:44 am

Re: Adding Genres to Song with VBScript

Post by skj88 »

I figured it out. The database is on a networked HTPC and I am trying to update from another PC on the network. I rescanned the HTPC C:/ drive with the network name instead of C:/ and I could update from the other PC. It created duplicate entries in the database (now it has two paths to the same file - 1)C:/ and 2) HTPC network name) but I can easily fix that.

Steve
Eyal
Posts: 3114
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Adding Genres to Song with VBScript

Post by Eyal »

BTW take a look at CustomFieldsTagger script by Steegy. http://www.mediamonkey.com/forum/viewto ... =2&t=58583
Working fine for bulk changing Genre field too.
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
skj88
Posts: 17
Joined: Sat Jul 02, 2011 10:44 am

Re: Adding Genres to Song with VBScript

Post by skj88 »

That looks like it may be useful. Thanks!
Post Reply