pippin;275360 Wrote: 
> If I find out how to change ratings without TrackStat I will probably
> add that functionality to iPeng, too.
At the moment you would need either TrackStat or iTunes Update plugin
to change ratings in SqueezeCenter, there is currently no functionality
in SqueezeCenter itself for this. SqueezeCenter without plugin just
implements storage of ratings imported during scanning, but doesn't
provide any way to change it without writing perl code. It would be
pretty worthless anyway since the ratings will be discarded anyway in
the current implementation at the next SqueezeCenter rescan.

The TrackStat plugin provides the CLI/JSON commands you are using, the
iTunes Update doesn't provide any similar commands yet. However, there
seems to be some half finished code in iTunes Update that does similar
things, only for setting the ratings though, not for getting them.

The TrackStat plugin currently provide a API for other plugins which
they can use if they like to hook into the TrackStat CLI/JSON commands
when a rating is set. This API is currently used by the iTunes Update
plugin. The result is that the following will happen when you issue a
"trackstat setrating" from the iPeng skin.
1. TrackStat receives the command
2. TrackStat stores the rating in the standard SqueezeCenter tables
(which will be cleared during rescan)
3. TrackStat stores the rating in its own tables (which won't be
cleared during rescan)
4. TrackStat issues a call to setTrackStatRating functions defined in
any other plugins.
5. The setTrackStatRating function is called in iTunes Update and it
calls iTunes using its external COM/OLE interface and sets the rating
in iTunes
6. TrackStat issues the "trackstat changedrating" notification  (which
I think the iPeng skin catches to update the rating stars in the
interface).

I think one of the reasons that SqueezeCenter hasn't implement rating
support itself yet, is that it is starting to be complex because the
scanning procedure currently start with clearing the all the standard
tables in the database. This would be a bad idea if the user has
modified information in the database that he likes to survive the
rescan. TrackStat solves this by using separate tables for the rating
information, iTunes Update solves it by using iTunes as the rating
storage. In both situations the ratings will survive the rescan since
the ratings aren't stored in the standard SqueezeCenter database tables
that are cleared.

For the rating stars in the "Now Playing" page it would be possible for
the iTunes Update plugin to implement similar CLI commands as TrackStat
do. It would probably be pretty simple since the core code is already
there in the iTunes Update plugin, it just needs a CLI/JSON command 
that wrapps it. However, one thing that is important to remember is
that this won't get you any ratings stars anywhere in the interface
besides on the "Now Playing" screen for the currently playing track.

The best solution would really be if SqueezeCenter itselfs implemented
the CLI command and the notification, and TrackStat and iTunes Update
just catched to notification to forward the rating to their respective
storage place. I'll start a thread in the developers forum regarding
this, to check if there are any interests among the developers.


-- 
erland

Erland Isaksson
'My homepage' (http://erland.homeip.net) 'My download page'
(http://erland.homeip.net/download)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library and Database Query plugins'
(http://wiki.erland.homeip.net/index.php/Category:SlimServer))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=44114

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to