Merge pull request #446 from mcarlton00/no-crashy-on-skip

Fix crash on addon load
This commit is contained in:
Odd Stråbø 2020-12-17 04:22:49 +01:00 committed by GitHub
commit 64b0ed29e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,10 +58,10 @@ class Events(object):
api_client = jellyfin_client.jellyfin api_client = jellyfin_client.jellyfin
addon_data = xbmc.translatePath("special://profile/addon_data/plugin.video.jellyfin/data.json") addon_data = xbmc.translatePath("special://profile/addon_data/plugin.video.jellyfin/data.json")
with open(addon_data, 'rb') as infile:
data = json.load(infile)
try: try:
with open(addon_data, 'rb') as infile:
data = json.load(infile)
server_data = data['Servers'][0] server_data = data['Servers'][0]
api_client.config.data['auth.server'] = server_data.get('address') api_client.config.data['auth.server'] = server_data.get('address')
api_client.config.data['auth.server-name'] = server_data.get('Name') api_client.config.data['auth.server-name'] = server_data.get('Name')