always enable default filters

This commit is contained in:
j 2019-11-15 16:44:43 +01:00
parent 95c08e929e
commit e06b263237

View file

@ -79,9 +79,9 @@ def load_config(init=False):
config['site']['googleapikey'] = getattr(settings, 'GOOGLE_API_KEY') config['site']['googleapikey'] = getattr(settings, 'GOOGLE_API_KEY')
config['site']['version'] = get_version() config['site']['version'] = get_version()
config['site']['dontValidateUser'] = not settings.AUTH_CHECK_USERNAME config['site']['dontValidateUser'] = not settings.AUTH_CHECK_USERNAME
if not 'folderdepth' in config['site']: if 'folderdepth' not in config['site']:
config['site']['folderdepth'] = settings.USE_IMDB and 4 or 3 config['site']['folderdepth'] = settings.USE_IMDB and 4 or 3
if 'sendReferrer' in config and not 'sendReferrer' in config['site']: if 'sendReferrer' in config and 'sendReferrer' not in config['site']:
config['site']['sendReferrer'] = config.pop('sendReferrer') config['site']['sendReferrer'] = config.pop('sendReferrer')
# enable default filters if needed # enable default filters if needed
@ -91,6 +91,13 @@ def load_config(init=False):
key['filter'] = True key['filter'] = True
sys.stderr.write('enabled filter for "%s" since its used as default filter.\n' % (key['id'])) sys.stderr.write('enabled filter for "%s" since its used as default filter.\n' % (key['id']))
# enable default document filters if needed
default_filters = [f['id'] for f in config['user']['ui']['documentFilters']]
for key in config['documentKeys']:
if key['id'] in default_filters and not key.get('filter'):
key['filter'] = True
sys.stderr.write('enabled filter for documeny key "%s" since its used as default filter.\n' % (key['id']))
config['keys'] = {} config['keys'] = {}
for key in config['itemKeys']: for key in config['itemKeys']:
config['keys'][key['id']] = key config['keys'][key['id']] = key