Cache streams.
authorstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Sun, 19 Aug 2012 12:00:55 +0000 (12:00 +0000)
committerstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Sun, 19 Aug 2012 12:00:55 +0000 (12:00 +0000)
git-svn-id: svn://svn.code.sf.net/p/xbmc-groove/code@79 2dec19e3-eb1d-4749-8193-008c8bba0994

default.py

index 099f21a..3a5551c 100644 (file)
@@ -521,7 +521,7 @@ class Grooveshark:
             xbmc.executebuiltin('XBMC.Notification(' + __language__(30008) + ', ' + __language__(30044) + ', 1000, ' + thumbDef + ')')
         
     # Make a song directory item
-    def songItem(self, songid, name, album, artist, coverart, trackLabelFormat=ARTIST_ALBUM_NAME_LABEL):
+    def songItem(self, songid, name, album, artist, coverart, trackLabelFormat=ARTIST_ALBUM_NAME_LABEL, tracknumber=1):
         
         stream = self._getSongStream(songid)
         if stream != False:
@@ -536,7 +536,7 @@ class Grooveshark:
                 trackLabel = artist + " - " + album + " - " + name
             item = xbmcgui.ListItem(label = trackLabel, thumbnailImage=songImg, iconImage=songImg)
             item.setPath(url)
-            item.setInfo( type="music", infoLabels={ "title": name, "album": album, "artist": artist, "duration": duration} )
+            item.setInfo( type="music", infoLabels={ "title": name, "album": album, "artist": artist, "duration": duration, "tracknumber" : tracknumber} )
             item.setProperty('mimetype', 'audio/mpeg')
             item.setProperty("IsPlayable", "true")
             item.setProperty('songid', str(songid))
@@ -766,7 +766,7 @@ class Grooveshark:
             album = song[2]
             artist = song[4]
             coverart = song[6]
-            item = self.songItem(songid, name, album, artist, coverart, trackLabelFormat)
+            item = self.songItem(songid, name, album, artist, coverart, trackLabelFormat, (n+1))
             if item != None:   
                 coverart = item.getProperty('coverart')
                 songname = song[0]