I've restructured my music source folder for various reasons.  Generally, I 
used to store files in the format %artist%/%album%/%track% - %title%, but I've 
decided to add another sub-folder, roughly categorising artists into their 
major genre (putting another sub-folder to the front of the path), so that I 
don't have too many artist folders in one root folder.

I exported trackstat data to a file first; the plan is to modify the content of 
the export and then purge trackstat stats and import the modified file back in.

However, modifying the xml file is a little awkward.  I have realised its going 
to take some time to do many search+replace operations treating the file as 
text.

I'm therefore thinking of writing something that will take the xml file and 
look in the SqueezeCenter DB to try to re-match the stats with new paths.

I'm thinking this would be best suited as an option for the Trackstat import, 
but I don't know if I can easily work out how to patch that (I'm not a perl 
wizz, and the trackstat code may be hard for me to get to grips with), so if 
such a utility doesn't already exist, I might write the code in .NET.

The algorithm seems easy enough:

for each trackstat path {
        if the path matches a urn in DB, import stats for that item
        else import into all song urn's that match the end-part of the 
trackstat path
}

I think it would be quite common for the root-part of the folder to change, but 
not the end-part (the artist, album, track number and song are less likely to 
change following a restructure).  Essentially, it would take the end of each 
urn, down three levels of folder separator (so it would find the match on 
"/artist/album/track - song").

I could write this as a .NET app that connected to the DB and read an XML file 
and produced a new XML file, but is there anything like this that already 
exists?  Would it be worth me trying to figure out how to do it within 
TrackStat?

Phil
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to