diff --git a/resources/lib/UserClient.py b/resources/lib/UserClient.py index 20e1d2a6..748f2202 100644 --- a/resources/lib/UserClient.py +++ b/resources/lib/UserClient.py @@ -150,6 +150,25 @@ class UserClient(threading.Thread): else: return s_cert + def setUserPref(self): + + server = self.getServer() + userId = self.getUserId() + addon = self.addon + + url = "%s/mediabrowser/Users/%s" % (server, userId) + result = self.doUtils.downloadUrl(url) + + audio = result[u'Configuration'].get(u'AudioLanguagePreference', "default") + subs = result[u'Configuration'].get(u'SubtitleLanguagePreference', "default") + addon.setSetting('Audiopref', audio) + addon.setSetting('Subspref', subs) + + self.logMsg("Audio preference: %s" % audio, 2) + self.logMsg("Subtitles preference: %s" % subs, 2) + + return True + def getPublicUsers(self): server = self.getServer() @@ -213,6 +232,9 @@ class UserClient(threading.Thread): self.resetClient() return False + # Set user preferences in settings + self.setUserPref() + # Set to windows property WINDOW.setProperty("currUser", username) WINDOW.setProperty("accessToken%s" % username, self.currToken)