mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Ensure file properties exists
For credentials and sync information
This commit is contained in:
parent
b35c7b5715
commit
5f9c071c39
2 changed files with 10 additions and 2 deletions
|
@ -227,7 +227,12 @@ def get_sync():
|
|||
with open(os.path.join(path, 'sync.json')) as infile:
|
||||
sync = json.load(infile)
|
||||
except Exception:
|
||||
sync = {'Libraries': [], 'RestorePoint': {}, 'Whitelist': []}
|
||||
sync = {}
|
||||
|
||||
sync['Libraries'] = sync.get('Libraries', [])
|
||||
sync['RestorePoint'] = sync.get('RestorePoint', {})
|
||||
sync['Whitelist'] = sync.get('Whitelist', [])
|
||||
sync['SortedViews'] = sync.get('SortedViews', [])
|
||||
|
||||
return sync
|
||||
|
||||
|
@ -254,7 +259,9 @@ def get_credentials():
|
|||
with open(os.path.join(path, 'data.json')) as infile:
|
||||
credentials = json.load(infile)
|
||||
except Exception:
|
||||
credentials = {'Servers': []}
|
||||
credentials = {}
|
||||
|
||||
credentials['Servers'] = credentials.get('Servers', [])
|
||||
|
||||
return credentials
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
##################################################################################################
|
||||
|
||||
import logging
|
||||
|
||||
import xbmc
|
||||
|
||||
import database
|
||||
|
|
Loading…
Reference in a new issue