Tuning.
authorstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Sat, 8 Oct 2011 09:15:49 +0000 (09:15 +0000)
committerstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Sat, 8 Oct 2011 09:15:49 +0000 (09:15 +0000)
git-svn-id: svn://svn.code.sf.net/p/xbmc-groove/code@66 2dec19e3-eb1d-4749-8193-008c8bba0994

addon.xml
changelog.txt
default.py
description.xml
resources/settings.xml

index 7827afb..050f00e 100644 (file)
--- a/addon.xml
+++ b/addon.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.audio.groove" name="Grooveshark XBMC"
-       version="0.6.2" provider-name="Stephen Denham">
+       version="0.6.3" provider-name="Stephen Denham">
        <requires>
                <import addon="xbmc.python" version="1.0" />
                <import addon="script.module.simplejson"/>
index 5608c3f..f90acd5 100644 (file)
@@ -1,3 +1,7 @@
+0.6.3
+
+Speed improvements.
+
 0.6.2
 
 Check item existence before adding to directory.
index 7e6b392..7742c24 100644 (file)
@@ -353,7 +353,7 @@ class Grooveshark:
                 artistID = artist[1]
                 if __debugging__ :
                     xbmc.log("Found " + artist[0] + "...")
-                albums = groovesharkApi.getArtistAlbums(artistID, limit = self.albumsearchlimit)
+                albums = groovesharkApi.getArtistAlbums(artistID, self.albumsearchlimit, True)
                 if (len(albums) > 0):
                     self._add_albums_directory(albums, artistID)
                 else:
@@ -440,7 +440,7 @@ class Grooveshark:
     # Show selected artist
     def artist(self, artistid):
         albums = groovesharkApi.getArtistAlbums(artistid, limit = self.albumsearchlimit)
-        self._add_albums_directory(albums, artistid)
+        self._add_albums_directory(albums, artistid, True)
     
     # Show selected playlist
     def playlist(self, playlistid, playlistname):
@@ -797,7 +797,7 @@ class Grooveshark:
         xbmcplugin.setPluginFanart(int(sys.argv[1]), self.fanImg)
     
     # Add albums to directory
-    def _add_albums_directory(self, albums, artistid=0):
+    def _add_albums_directory(self, albums, artistid=0, isverified=False):
         n = len(albums)
         itemsExisting = n
         if __debugging__ :
@@ -806,7 +806,7 @@ class Grooveshark:
         while i < n:
             album = albums[i]
             albumID = album[3]
-            if groovesharkApi.getDoesAlbumExist(albumID):                    
+            if isverified or groovesharkApi.getDoesAlbumExist(albumID):                    
                 albumArtistName = album[0]
                 albumName = album[2]
                 albumImage = self._get_icon(album[4], 'album-' + str(albumID))
@@ -910,7 +910,7 @@ class Grooveshark:
         id = int(songid)
         duration = -1
         durations = []
-        path = os.path.join(cacheDir, 'durations.dmp')
+        path = os.path.join(cacheDir, 'duration.dmp')
         try:
             f = open(path, 'rb')
             durations = pickle.load(f)
@@ -922,12 +922,13 @@ class Grooveshark:
         except:
             pass
 
-        # Not in cache but exists
-        if duration < 0 and groovesharkApi.getDoesSongExist(songid):
+        # Not in cache
+        if duration < 0:
             stream = groovesharkApi.getSubscriberStreamKey(songid)
-            duration = self._setDuration(stream['uSecs'])
-            song = [id, duration]
-            self._setSongDuration(song, durations)
+            if stream != False and stream['url'] != '':
+                duration = self._setDuration(stream['uSecs'])
+                song = [id, duration]
+                self._setSongDuration(song, durations)
 
         return duration
         
@@ -937,7 +938,7 @@ class Grooveshark:
             # Create the cache directory if it doesn't exist.
             if not os.path.exists(cacheDir):
                 os.makedirs(cacheDir)
-            path = os.path.join(cacheDir, 'durations.dmp')
+            path = os.path.join(cacheDir, 'duration.dmp')
             f = open(path, 'wb')
             pickle.dump(durations, f, protocol=pickle.HIGHEST_PROTOCOL)
             f.close()
index 420a647..a14fb62 100644 (file)
@@ -18,7 +18,7 @@
        <title>Grooveshark XBMC</title>
 
        <!-- (required) Major.minor.build -->
-       <version>0.6.2</version>
+       <version>0.6.3</version>
 
        <!--
                (required) author name & email. at least one author name is required
index bc53b00..521e914 100644 (file)
@@ -7,7 +7,7 @@
    <setting id="songsearchlimit" type="labelenum" label="30002" default="20" values="5|10|15|20|25|30|40|50|60|70|80|90|100" />
    <setting id="albumsearchlimit" type="labelenum" label="30003" default="10" values="5|10|15|20|25|30|40|50|60|70|80|90|100" />
    <setting id="artistsearchlimit" type="labelenum" label="30004" default="10" values="5|10|15|20|25|30|40|50|60|70|80|90|100" />
-   <setting id="songspagelimit" type="labelenum" label="30005" default="100" values="10|20|30|40|50|60|70|80|90|100|200|500" />
+   <setting id="songspagelimit" type="labelenum" label="30005" default="10" values="10|20|30|40|50|60|70|80|90|100|200|500" />
    </category>
    <category label="Other">
                <setting id="debug" label="Debug" type="bool" default="false" />