Import script

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

Moderator: Gurus

Import script

Postby luny on Mon Nov 02, 2009 11:16 pm

Hello,

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??
luny
 

Re: Import script

Postby trixmoto on Tue Nov 03, 2009 1:23 pm

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.
Loving the Monkey? - Get Gold!
Check out my scripts and more at http://trixmoto.net or check out my top ten downloaded scripts
trixmoto
 
Posts: 7636
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Re: Import script

Postby Guest on Wed Nov 04, 2009 11: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"

Thx!
Guest
 


Return to Addons developer forum

Who is online

Users browsing this forum: No registered users and 1 guest