Import script

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

Moderator: Gurus


Import script

Post by luny » Mon Nov 02, 2009 6:16 pm


I'm trying to get a script working that imports the rating and playcount settings from SqueezeCenter.
In Squeezecenter, I managed to export the file(TrackStat_iTunes_Complete.txt), that looks like this:

Squeezecenter file:
Sun|||/volume1/music/FLAC/154 - [2004] - Strike/154 - Strike - 01 - Sun.flac|rated||100||1246395922

Filepath in MM :
Y:/FLAC/154 - [2004] - Strike/154 - Strike - 01 - Sun.flac

The script that I use, is trying to find the songpath in my MM DB, but it never finds 1.

songpath = 4 part of the file-line
songpath = mid(arr(3),15)
Set sit = SDB.Database.QuerySongs("AND (Songs.songpath = '"&Replace(songpath,"'","''")&"')")

Can anybody please give me hint how to make the script work??

Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Re: Import script

Post by trixmoto » Tue Nov 03, 2009 8:23 am

I imagine that you're problem stems from the fact that SongPath field will contain ":\FLAC\154 - [2004] - Strike\154 - Strike - 01 - Sun.flac". Notice the fact that the drive letter is not included, this is stored in a separate field using a lookup table, and also the fact that the slashes are the other way round.
Download 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.


Re: Import script

Post by Guest » Wed Nov 04, 2009 6:02 am

I was aware of the slashes and the drive letter, but I overlooked the ":" in ":\FLAC\154 - [2004] - Strike\154 - Strike - 01 - Sun.flac"


Post Reply