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): def __init__(self, configFolder=None):
self.set = Settings(configFolder) self.set = Settings(configFolder)
self.dz = Deezer() self.dz = Deezer()
self.dz.set_accept_language(self.set.settings.get('tagsLanguage'))
self.sp = SpotifyHelper(configFolder) self.sp = SpotifyHelper(configFolder)
self.qm = QueueManager(self.sp) self.qm = QueueManager(self.sp)

View File

@ -58,6 +58,7 @@ class Settings:
"albumVariousArtists": True, "albumVariousArtists": True,
"removeAlbumVersion": False, "removeAlbumVersion": False,
"removeDuplicateArtists": False, "removeDuplicateArtists": False,
"tagsLanguage": "",
"featuredToTitle": "0", "featuredToTitle": "0",
"titleCasing": "nothing", "titleCasing": "nothing",
"artistCasing": "nothing", "artistCasing": "nothing",
@ -136,8 +137,9 @@ class Settings:
remove(path.join(logspath, logslist[i])) remove(path.join(logspath, logslist[i]))
# Saves the settings # Saves the settings
def saveSettings(self, newSettings=None): def saveSettings(self, newSettings=None, dz=None):
if newSettings: if newSettings:
if dz and newSettings.get('tagsLanguage') != self.settings.get('tagsLanguage'): dz.set_accept_language(newSettings.get('tagsLanguage'))
self.settings = newSettings self.settings = newSettings
with open(path.join(self.configFolder, 'config.json'), 'w') as configFile: with open(path.join(self.configFolder, 'config.json'), 'w') as configFile:
json.dump(self.settings, configFile, indent=2) json.dump(self.settings, configFile, indent=2)