documentRightsLevel

This commit is contained in:
j 2017-12-15 13:12:30 +00:00
parent c640d1253e
commit 2bfaf3809b

View file

@ -107,7 +107,7 @@ def load_config(init=False):
# add missing defaults # add missing defaults
for section in sorted(( for section in sorted((
'capabilities', 'cantPlay', 'capabilities', 'cantPlay',
'documentKeys', 'documentRightsLevels', 'documentRightsLevel', 'documentKeys', 'documentRightsLevels',
'entities', 'itemName', 'itemTitleKeys', 'itemKeys', 'media', 'posters', 'entities', 'itemName', 'itemTitleKeys', 'itemKeys', 'media', 'posters',
'site', 'tv', 'user.ui', 'user.ui.part', 'user.ui.showFolder', 'site', 'tv', 'user.ui', 'user.ui.part', 'user.ui.showFolder',
'menuExtras', 'languages' 'menuExtras', 'languages'
@ -139,6 +139,14 @@ def load_config(init=False):
if added: if added:
sys.stderr.write("adding default %s:\n\t" % section) sys.stderr.write("adding default %s:\n\t" % section)
sys.stderr.write("\n\t".join(added) + '\n\n') sys.stderr.write("\n\t".join(added) + '\n\n')
key = 'documentRightsLevel'
if key not in config:
config[key] = {}
for level in config['userLevels']:
if level not in config[key]:
config[key] = default.get(key, 0)
for key in ('language', 'importMetadata'): for key in ('language', 'importMetadata'):
if key not in config: if key not in config:
sys.stderr.write("adding default value:\n\t\"%s\": %s,\n\n" % (key, json.dumps(default[key]))) sys.stderr.write("adding default value:\n\t\"%s\": %s,\n\n" % (key, json.dumps(default[key])))