Page 1 of 1

Adding Genres to Song with VBScript

Posted: Wed Oct 12, 2011 11:56 pm
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

Re: Adding Genres to Song with VBScript

Posted: Fri Oct 14, 2011 6:20 pm
by Eyal
I tried it on one song and it's working fine. When I re-scan the folder, the genre does not change.

Re: Adding Genres to Song with VBScript

Posted: Sat Oct 15, 2011 1:09 am
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

Re: Adding Genres to Song with VBScript

Posted: Sat Oct 15, 2011 2:59 am
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.

Re: Adding Genres to Song with VBScript

Posted: Sat Oct 15, 2011 12:23 pm
by skj88
That looks like it may be useful. Thanks!