mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-23 08:22:46 +00:00
Hotfix (#72)
* Fix external subtitles * Fix index error * Fix credentials encoding * Fix music var reference
This commit is contained in:
parent
c6b747cb04
commit
ea4059b6d0
5 changed files with 14 additions and 10 deletions
|
@ -34,12 +34,15 @@ class Credentials(object):
|
|||
if self.credentials is None:
|
||||
try:
|
||||
with open(os.path.join(self.path, 'data.txt')) as infile:
|
||||
self.credentials = json.load(unicode(infile))
|
||||
|
||||
self.credentials = json.load(infile)
|
||||
|
||||
if not isinstance(self.credentials, dict):
|
||||
raise ValueError("invalid credentials format")
|
||||
|
||||
except Exception as e: # File is either empty or missing
|
||||
log.warn(e)
|
||||
self.credentials = {}
|
||||
|
||||
|
||||
log.info("credentials initialized with: %s" % self.credentials)
|
||||
self.credentials['Servers'] = self.credentials.setdefault('Servers', [])
|
||||
|
||||
|
@ -54,7 +57,9 @@ class Credentials(object):
|
|||
self.credentials = data
|
||||
# Set credentials to file
|
||||
with open(os.path.join(self.path, 'data.txt'), 'w') as outfile:
|
||||
json.dump(unicode(data), outfile, indent=4, ensure_ascii=False)
|
||||
for server in data['Servers']:
|
||||
server['Name'] = server['Name'].encode('utf-8')
|
||||
json.dump(data, outfile, ensure_ascii=False)
|
||||
else:
|
||||
self._clear()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue