# along with xbmc-groove. If not, see <http://www.gnu.org/licenses/>.
-import urllib, sys, os, shutil, re, pickle, time, tempfile, xbmcaddon, xbmcplugin, xbmcgui, xbmc
+import urllib, sys, os, shutil, re, pickle, time, traceback, xbmcaddon, xbmcplugin, xbmcgui, xbmc
__addon__ = xbmcaddon.Addon('plugin.audio.groove')
__addonname__ = __addon__.getAddonInfo('name')
libDir = xbmc.translatePath(os.path.join(resDir, 'lib'))
imgDir = xbmc.translatePath(os.path.join(resDir, 'img'))
cacheDir = os.path.join(xbmc.translatePath('special://masterprofile/addon_data/'), os.path.basename(baseDir))
+tempDir = xbmc.translatePath('special://temp')
thumbDirName = 'thumb'
thumbDir = os.path.join(xbmc.translatePath('special://masterprofile/addon_data/'), os.path.basename(baseDir), thumbDirName)
__debugging__ = False
try:
- groovesharkApi = GrooveAPI(__debugging__)
+ groovesharkApi = GrooveAPI(__debugging__, tempDir)
if groovesharkApi.pingService() != True:
raise StandardError(__language__(30007))
except:
+ print "Exception on initialisation"
+ print '-'*60
+ traceback.print_exc()
+ print '-'*60
dialog = xbmcgui.Dialog(__language__(30008),__language__(30009),__language__(30010))
dialog.ok(__language__(30008),__language__(30009))
sys.exit(-1)
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]
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
dialog.ok(__language__(30008), __language__(30069), __language__(30070), __language__(30082))
return 0
else:
- if self.userid == 0:
- uid = groovesharkApi.login(self.username, self.password)
+ uid = groovesharkApi.login(self.username, self.password)
if (uid != 0):
return uid
else: