Tuesday, 11 November 2008

TwonkyScrobbler V1.0.1

I have released an update to the TwonkyScrobbler. A user on the Twonkyvision forum highlighted a problem when using it with an older version of the server.

TwonkyScrobbler was developed and tested using the latest TwonkyMedia version 4.4.9. The RSS feed facility was introduced in version 4.1 and I had made the incorrect assumption that the RSS feed format had remained unchanged.

In Version 4.4.9 I observed the items in the RSS feed have the following format

<item>
<title>Gemini</title>
<link>http://192.168.0.20:9000/disk/O1$11$207905894$2623831632.mp3</link>
<description>Eye In The Sky</description>
<author>Alan Parsons Project, The</author>
<enclosure url=http://192.168.0.20:9000/disk/O1$11$207905894$2623831632.mp3 type="audio/mpeg" />
<pubDate>Mon, 01 Jan 1981 01:00:00 GMT</pubDate>
<moddatetime>Thu, 20 Apr 2006 20:38:10 GMT</moddatetime>
<playeddatetime>Sat, 08 Nov 2008 07:44:01 GMT</playeddatetime>
<class>object.item</class>
<genre>Rock</genre>
<playcount>1</playcount>
<tracknumber>32148</tracknumber>
<duration>131000</duration>
<bitrate>192</bitrate>
<frequency>44100</frequency>
<audiochannels>2</audiochannels>
</item>


The scrobbler was using the element <playeddatetime> to determine if the song was a new one, storing the value in the program configuration file.

Following the bug report I installed a much older version (4.2.1) on another PC and discovered that items in the RSS feed have much less information.

<item>
<title>Old Ghosts</title>
<link>http://192.168.0.21:9000/disk/O1$11$134217730$2550136852.mp3</link>
<description>Stormwatch</description>
<author>Jethro Tull</author>
<enclosure url="http://192.168.0.21:9000/disk/O1$11$134217730$2550136852.mp3" type="audio/mpeg" />
<pubDate>Mon, 28 Apr 2008 12:59:26 GMT</pubDate>
</item>


This obviously created a problem because the required information is missing, the <pubDate> element isn’t related to the time the song was played.

To attempt to remedy this problem I have modified the scrobbler so it attempts to find the element, however if it is missing the other information title,description and author (i.e. title, album and artist) is compared to the last scrobbled track and any difference is assumed to signal a new track and the new track is scrobbled using the current time as the played time.

Twonkyvision had made reference to this fact in the RevisionHistory.txt file
What's new in Version 4.4.3.1
------------------------------

+ DivX and WMV support for PS3 (4.4.3.1)
+ AAC support for PS3!
+ Time information for pictures on PS3
+ added Album Artist and Album Art for OGG and FLAC
+ added rss feed support for all content types. Start with http://127.0.0.1:9000/rss/feed
+ enhanced generated rss XML feed by more properties


Updating from V1.0 will require a new configuration/state file with the extra data.

Labels: , , ,

Bookmark and Share

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home