mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
In preparation of audio/subs pref
This commit is contained in:
parent
20ac3c9465
commit
23e039fd43
1 changed files with 22 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue