Switch to using xdg cache folder for spotify cache

This commit is contained in:
Thomas Adamcik 2011-07-17 01:41:22 +02:00
parent 6f268cd491
commit ee856dd06e
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,4 @@
import glib
import logging
import os
import threading
@ -18,12 +19,15 @@ from mopidy.utils.process import BaseThread
logger = logging.getLogger('mopidy.backends.spotify.session_manager')
DEFAULT_CACHE_LOCATION = os.path.join(glib.get_user_cache_dir(), 'spotify')
# pylint: disable = R0901
# SpotifySessionManager: Too many ancestors (9/7)
class SpotifySessionManager(BaseThread, PyspotifySessionManager):
cache_location = settings.SPOTIFY_CACHE_PATH
settings_location = settings.SPOTIFY_CACHE_PATH
settings_location = settings.SPOTIFY_CACHE_PATH or DEFAULT_CACHE_LOCATION
appkey_file = os.path.join(os.path.dirname(__file__), 'spotify_appkey.key')
user_agent = 'Mopidy %s' % get_version()

View File

@ -237,7 +237,7 @@ SHOUTCAST_OUTPUT_ENCODER = u'lame mode=stereo bitrate=320'
#: Path to the Spotify cache.
#:
#: Used by :mod:`mopidy.backends.spotify`.
SPOTIFY_CACHE_PATH = u'~/.mopidy/spotify_cache'
SPOTIFY_CACHE_PATH = u''
#: Your Spotify Premium username.
#: