How to get SDBSongData from a path

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

Moderator: Gurus

CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

How to get SDBSongData from a path

Post by CarlitoGil » Sat Oct 17, 2009 5:25 am

Say I have any given path, how do I get it's SDBSongData object only if it is in the database?
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid

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

Re: How to get SDBSongData from a path

Post by trixmoto » Sat Oct 17, 2009 8:01 am

I've not got the code on me write now but my "Recreate M3U" script does this. The SQL for QuerySongs is something like...

"AND Songs.Path = ':\Music\Artist\Album\Track.mp3' "

...or you can use LIKE if you only have part of it. The path does not include the drive letter though, this is stored in a separate table.
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.

Post Reply