Implemented tagsLanguage setting

This commit is contained in:
RemixDev 2020-09-20 11:14:54 +02:00
parent 4e7b170720
commit 0848941583
2 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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)