From: stephendenham Date: Thu, 24 Apr 2014 16:58:33 +0000 (+0000) Subject: Fix for Android temp directory. X-Git-Url: https://git.hcoop.net/clinton/xbmc-groove.git/commitdiff_plain/8b52a99b3785291230638d6ea1d388e1da0599b7 Fix for Android temp directory. git-svn-id: svn://svn.code.sf.net/p/xbmc-groove/code@95 2dec19e3-eb1d-4749-8193-008c8bba0994 --- diff --git a/addon.xml b/addon.xml index 87e5b44..8a0c758 100644 --- a/addon.xml +++ b/addon.xml @@ -1,6 +1,6 @@  + version="2.0.9" provider-name="Stephen Denham"> diff --git a/changelog.txt b/changelog.txt index 8e7d8df..e521ff5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +2.0.9 + +Fix for Android temp directory. + 2.0.8 Fix for multiuser environment. diff --git a/default.py b/default.py index 8667bfc..a97b11e 100644 --- a/default.py +++ b/default.py @@ -76,6 +76,7 @@ resDir = xbmc.translatePath(os.path.join(baseDir, 'resources')) 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) @@ -99,7 +100,7 @@ else: __debugging__ = False try: - groovesharkApi = GrooveAPI(__debugging__) + groovesharkApi = GrooveAPI(__debugging__, tempDir) if groovesharkApi.pingService() != True: raise StandardError(__language__(30007)) except: diff --git a/resources/lib/GroovesharkAPI.py b/resources/lib/GroovesharkAPI.py index 9376956..21e2bc1 100644 --- a/resources/lib/GroovesharkAPI.py +++ b/resources/lib/GroovesharkAPI.py @@ -42,14 +42,14 @@ class GrooveAPI: _debugging = False # Constructor - def __init__(self, debug): + def __init__(self, debug, tempDir): self._debugging = debug self.simplejson = simplejson if "linux" in sys.platform.lower(): socket.setdefaulttimeout(30) - self.cacheDir = os.path.join(tempfile.gettempdir(),getpass.getuser() + '_' + 'groovesharkapi') + self.cacheDir = tempDir if os.path.isdir(self.cacheDir) == False: os.makedirs(self.cacheDir) if self._debugging: