Fix session handling.
authorstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Thu, 24 Apr 2014 20:02:50 +0000 (20:02 +0000)
committerstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Thu, 24 Apr 2014 20:02:50 +0000 (20:02 +0000)
git-svn-id: svn://svn.code.sf.net/p/xbmc-groove/code@96 2dec19e3-eb1d-4749-8193-008c8bba0994

default.py
resources/lib/GroovesharkAPI.py

index a97b11e..3ae1e04 100644 (file)
@@ -529,7 +529,7 @@ class Grooveshark:
     def songItem(self, songid, name, album, artist, coverart, trackLabelFormat=ARTIST_ALBUM_NAME_LABEL, tracknumber=1):
         
         stream = self._getSongStream(songid)
     def songItem(self, songid, name, album, artist, coverart, trackLabelFormat=ARTIST_ALBUM_NAME_LABEL, tracknumber=1):
         
         stream = self._getSongStream(songid)
-        if stream != False:
+        if stream != None:
             duration = stream[1]
             url = stream[2]
             key = stream[3]
             duration = stream[1]
             url = stream[2]
             key = stream[3]
@@ -555,7 +555,7 @@ class Grooveshark:
             item.setProperty('fanart_image', self.fanImg)
             return item
         else:
             item.setProperty('fanart_image', self.fanImg)
             return item
         else:
-            xbmc.log("No song URL")
+            xbmc.log("No access to song URL")
             return None
     
     # Next page of songs
             return None
     
     # Next page of songs
index 21e2bc1..c34d3ea 100644 (file)
@@ -129,7 +129,7 @@ class GrooveAPI:
                        return ''
        
        def _getSavedSession(self):
                        return ''
        
        def _getSavedSession(self):
-               path = os.path.join(self.cacheDir, 'session.dmp')
+               path = os.path.join(self.cacheDir, 'groovesharksession.dmp')
                try:
                        f = open(path, 'rb')
                        session = pickle.load(f)
                try:
                        f = open(path, 'rb')
                        session = pickle.load(f)
@@ -152,7 +152,7 @@ class GrooveAPI:
                        # Create the directory if it doesn't exist.
                        if not os.path.exists(self.cacheDir):
                                os.makedirs(self.cacheDir)
                        # Create the directory if it doesn't exist.
                        if not os.path.exists(self.cacheDir):
                                os.makedirs(self.cacheDir)
-                       path = os.path.join(self.cacheDir, 'session.dmp')
+                       path = os.path.join(self.cacheDir, 'groovesharksession.dmp')
                        f = open(path, 'wb')
                        session = { 'sessionID' : self._sessionID, 'lastSessionTime' : self._lastSessionTime, 'userID': self._userID, 'ip' : self._ip, 'country' : self._country } 
                        pickle.dump(session, f, protocol=pickle.HIGHEST_PROTOCOL)
                        f = open(path, 'wb')
                        session = { 'sessionID' : self._sessionID, 'lastSessionTime' : self._lastSessionTime, 'userID': self._userID, 'ip' : self._ip, 'country' : self._country } 
                        pickle.dump(session, f, protocol=pickle.HIGHEST_PROTOCOL)