Hi all,
I'm new to scripting MediaMonkey (and to Media Monkey in general). I used to use iTunes and wrote a few scripts to save my ratings out to the ID3 tag. Now that I'm using Media Monkey, I'd like to write a quick script which will import my ratings into the MM format. I understand Media Monkey stores the ratings in the POPM tag, but I have my ratings in the comments section (I wasn't sure how to get iTunes to write anything else).
(Another approach could be to write something which converts my tags to the MM format...)
It seems like there is ample documentation, and I've looked through some of the API, but although it is straightforward to get a list of the current songs playing, it's not immediately obvious how to access the entire database to iterate over all tracks. I know this is an obvious thing, but I haven't seen a very straightforward example thus far, which does not involve SQL querys (I am not familiar with that.)
If somebody can't point me to something which I can use as a reference I should be able to figure out what I need to know. But in the meantime I thought I'd say hi and see if there was anything on the forums which I could leverage.
Thanks and take care
Script to import ratings from ID3
Moderators: Gurus, Addon Administrators
Re: Script to import ratings from ID3
You'll either need to use SDB.Database.QuerySongs or SDB.Database.OpenSQL, but either way these use SQL. The first returns a SongIterator though whereas the second returns a DBIterator. Here's how I'd do it...
Code: Select all
Dim iter : Set iter = SDB.Database.QuerySongs("")
Do While Not iter.EOF
Dim song : Set song = iter.Item
'do whatever with the song here
iter.Next
Loop
Set iter = NothingDownload my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Re: Script to import ratings from ID3
In addition From time to time add SDB.ProcessMessages so that MM can do the background tasks while your script is executing. That will make MM still usable over long periods of Script Execution.
Feel free to share any ideas and we will try to help you as much as possible. Enjoy your stay here and welcome.
Feel free to share any ideas and we will try to help you as much as possible. Enjoy your stay here and welcome.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying



How to attach PICTURE/SCREENSHOTS to forum posts
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying



How to attach PICTURE/SCREENSHOTS to forum posts