From 0848941583f14ecb79dbf78617133d38e59f7a6f Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 20 Sep 2020 11:14:54 +0200 Subject: [PATCH] Implemented tagsLanguage setting --- deemix/app/__init__.py | 1 + deemix/app/settings.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/deemix/app/__init__.py b/deemix/app/__init__.py index a88dfff..66da18c 100644 --- a/deemix/app/__init__.py +++ b/deemix/app/__init__.py @@ -7,5 +7,6 @@ class deemix: def __init__(self, configFolder=None): self.set = Settings(configFolder) self.dz = Deezer() + self.dz.set_accept_language(self.set.settings.get('tagsLanguage')) self.sp = SpotifyHelper(configFolder) self.qm = QueueManager(self.sp) diff --git a/deemix/app/settings.py b/deemix/app/settings.py index 485951a..4d45bf3 100644 --- a/deemix/app/settings.py +++ b/deemix/app/settings.py @@ -58,6 +58,7 @@ class Settings: "albumVariousArtists": True, "removeAlbumVersion": False, "removeDuplicateArtists": False, + "tagsLanguage": "", "featuredToTitle": "0", "titleCasing": "nothing", "artistCasing": "nothing", @@ -136,8 +137,9 @@ class Settings: remove(path.join(logspath, logslist[i])) # Saves the settings - def saveSettings(self, newSettings=None): + def saveSettings(self, newSettings=None, dz=None): if newSettings: + if dz and newSettings.get('tagsLanguage') != self.settings.get('tagsLanguage'): dz.set_accept_language(newSettings.get('tagsLanguage')) self.settings = newSettings with open(path.join(self.configFolder, 'config.json'), 'w') as configFile: json.dump(self.settings, configFile, indent=2)