erland;278455 Wrote: 
> - How are the log stored ? Is it stored in the database or as a separate
> file ?
> - The web interface you are talking about is that only the
> SqueezeCenter web interface or is it something that could be published
> on an external web server ?

The logs are XML files in a new directory (PlayLogSongLogs) inside the
SC7 cache directory (the only place I thought I could assume my plugin
would have write privileges). There's no formal DTD, but the document
should be generally well-formed. It contains more data than the web
page displays (time in time() format, a "guid" for a given song, other
metadata). Once I really start looking at performance issues (logging
is fast, but display of a 1000+ line log can take a few seconds, which
is not good in a single-threaded app like SC7), I may want to move to
using MySQL. Here's a sample entry for a local MP3 -- though PlayLog
looks for additional metadata and logs it if available:


Code:
--------------------
    <song>
  <album>Ramones Mania</album>
  <artist>Ramones</artist>
  <comment>Comment from the ID3 tag</comment>
  <date>2008/03/08 09:28:18</date>
  <duration>2:29</duration>
  <guid>1204986498-149804</guid>
  <path>/path/to/ramones_mania/01_i_wanna_be_sedated.mp3</path>
  <playerId>aa:bb:cc:dd:ee:ff</playerId>
  <playerName>Local</playerName>
  <time>1204986498</time>
  <title>I Wanna Be Sedated</title>
  </song>
  
--------------------


Here's an Internet Radio (MP3 stream) sample:

Code:
--------------------
    <song>
  <artist>Br549</artist>
  <date>2008/03/12 08:19:22</date>
  <displayedTitle>Br549 - Seven Nights To Rock</displayedTitle>
  <guid>1205324362-7712344</guid>
  <path>http://207.200.96.230:8014/</path>
  <playerId>aa:bb:cc:dd:ee:ff</playerId>
  <playerName>Local</playerName>
  <time>1205324362</time>
  <title>Seven Nights To Rock</title>
  </song>
--------------------



The tabular HTML interface is built on SC7/TT APIs. You could probably
save the HTML and republish it, esp. if you made a SC7 skin with simple
pageheader/pagefooter templates (I'd also be happy to add SGML comments
to facilitate this). The plugin also offers a SC7 URL for downloading
the raw XML -- the XML file itself is a collection of <song> entities,
and the "Download
XML" link in the PlayLog web UI wraps those with a simple container
element to appease XML::Simple and other parsers.
I thought there would be interest in an export designed for spreadsheet
programs, too, though I hadn't thought much about whether to include all
XML data or just what's displayed on the web page.

If you're interested (I was thinking of TrackStat), there is a public
API for other plugins. Currently it's limited to asking PlayLog to
record a normal entry for the song currently playing on a specific
player, which only really makes sense if PlayLog is in Manual mode, or
Internet Radio mode if the user's rating a local song (i.e., if PlayLog
wasn't already logging as soon as each sog started) -- though certainly
PlayLog could "rewind" in the XML log and re-write an entry, that's
just a little more work. But my thought was that a user who wanted to
rate a song favorably might want to record that fact for PlayLog. I've
thought about the PlayLog API allowing calling plugins to do things
like pass hashtable entries for adding additional tags, e.g. passing {
'trackstatRating' => 4 } might add
"<trackstatRating>4</trackstatRating>" to the XML file. Perhaps a more
complex hashtable like { 'tagname' => 'trackstatRating', 'value' =>
'4', 'showInHTMLTable' => 1, 'htmlColumnSortable' => 1 ,
'htmlColumnDefault => '', 'stringName' => 'TRACKSTAT_RATING' } would do
that and tell PlayLog to do that and to display the TrackStat rating in
the web page, allow the user to sort the HTML table by TrackStat
rating, specfify to use a blank string for songs with no rating, and
speficy the token to use with string() to internationalize the HTML
table (and spreadsheet export).


-- 
peterw

http://www.tux.org/~peterw/
free plugins: http://www.tux.org/~peterw/#slim
AllQuiet BlankSaver FuzzyTime PlayLog PowerCenter/BottleRocket
SaverSwitcher SleepFade StatusFirst SyncOptions VolumeLock
------------------------------------------------------------------------
peterw's Profile: http://forums.slimdevices.com/member.php?userid=2107
View this thread: http://forums.slimdevices.com/showthread.php?t=44582

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

Reply via email to