Re: [Rhythmbox-devel] [Libre-fm] scrobble free 0.1 released



On Thu, 2009-05-07 at 00:12 +1000, Michael Gratton wrote:
> Patches, bug reports and feature requests welcome!

Attached patch adds support for MBIDs. Not extensively tested.

-Toby
--- scrobblefree/__init__.py	2009-05-06 13:53:25.000000000 +0100
+++ /usr/lib64/rhythmbox/plugins/scrobblefree/__init__.py	2009-05-07 12:14:43.000000000 +0100
@@ -139,6 +139,7 @@
             title = self.db.entry_get(entry, rhythmdb.PROP_TITLE)
             duration = self.db.entry_get(entry, rhythmdb.PROP_DURATION)
             track_no = self.db.entry_get(entry, rhythmdb.PROP_TRACK_NUMBER)
+            mbid = self.db.entry_get(entry, rhythmdb.PROP_MUSICBRAINZ_TRACKID)
 
             stream_title = \
                 self.db.entry_request_extra_metadata(entry,
@@ -154,7 +155,7 @@
                             entry_request_extra_metadata(entry,
                                                          'rb:stream-song-album')
 
-            self.current_track = Track(artist, album, title, track_no, duration)
+            self.current_track = Track(artist, album, title, track_no, duration, mbid)
 
     def _extra_metadata_changed_cb(self, db, entry, field, metadata):
         # XXX anything interesting here?
@@ -165,7 +166,7 @@
 class Track(object):
 
 
-    def __init__(self, artist, album, title, track, duration):
+    def __init__(self, artist, album, title, track, duration, mbid):
         self.started = int(time.time())
         self.elapsed = 0
         self.played = False
@@ -175,6 +176,7 @@
         self.title = title
         self.track = track
         self.duration = duration
+        self.mbid = mbid
 
     @property
     def shouldPlay(self):
@@ -201,4 +203,5 @@
                            "",
                            str(self.duration),
                            self.album,
-                           str(self.track))
+                           str(self.track),
+                           self.mbid)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]