Removing data_dir in favor of Extension.get_data_dir, #547
This commit is contained in:
@ -22,6 +22,7 @@ services:
|
||||
# Uncomment these lines to use a host-managed development build
|
||||
#- ./mopidy_iris:/iris/mopidy_iris
|
||||
#- ./IRIS_VERSION:/iris/IRIS_VERSION
|
||||
- ./docker/data:/var/lib/mopidy/iris
|
||||
- ./docker/mopidy.conf:/config/mopidy.conf
|
||||
- HOST_MUSIC_DIRECTORY:/var/lib/mopidy/media
|
||||
- HOST_SNAPCAST_TEMP:/tmp
|
||||
|
||||
@ -30,7 +30,7 @@ class Extension(ext.Extension):
|
||||
schema["spotify_authorization_url"] = config.String()
|
||||
schema["lastfm_authorization_url"] = config.String()
|
||||
schema["genius_authorization_url"] = config.String()
|
||||
schema["data_dir"] = config.String()
|
||||
schema["data_dir"] = config.String() # Deprecated
|
||||
return schema
|
||||
|
||||
def setup(self, registry):
|
||||
|
||||
@ -72,7 +72,7 @@ class IrisCore(pykka.ThreadingActor):
|
||||
# @return Dict
|
||||
##
|
||||
def load_from_file(self, name):
|
||||
file_path = Path(self.config["iris"]["data_dir"]) / ("%s.pkl" % name)
|
||||
file_path = Extension.get_data_dir(self.config) / ("%s.pkl" % name)
|
||||
|
||||
try:
|
||||
with file_path.open("rb") as f:
|
||||
@ -90,7 +90,7 @@ class IrisCore(pykka.ThreadingActor):
|
||||
# @return void
|
||||
##
|
||||
def save_to_file(self, dict, name):
|
||||
file_path = Path(self.config["iris"]["data_dir"]) / ("%s.pkl" % name)
|
||||
file_path = Extension.get_data_dir(self.config) / ("%s.pkl" % name)
|
||||
|
||||
try:
|
||||
with file_path.open("wb") as f:
|
||||
|
||||
Reference in New Issue
Block a user