add migration for autocompleteSort
This commit is contained in:
parent
ab75b70c5b
commit
117d2a504d
1 changed files with 6 additions and 0 deletions
|
@ -16,6 +16,7 @@ import ox.jsonc
|
||||||
from ox.utils import json
|
from ox.utils import json
|
||||||
|
|
||||||
from archive.extract import supported_formats, AVCONV
|
from archive.extract import supported_formats, AVCONV
|
||||||
|
from item.utils import get_by_id
|
||||||
|
|
||||||
|
|
||||||
_win = (sys.platform == "win32")
|
_win = (sys.platform == "win32")
|
||||||
|
@ -85,6 +86,11 @@ def load_config():
|
||||||
section, key, str(d[key])))
|
section, key, str(d[key])))
|
||||||
c[key] = d[key]
|
c[key] = d[key]
|
||||||
|
|
||||||
|
key = get_by_id(config['itemKeys'], 'title')
|
||||||
|
if not 'autocompleteSort' in key:
|
||||||
|
key['autocompleteSort'] = get_by_id(default['itemKeys'], 'title')['autocompleteSort']
|
||||||
|
sys.stderr.write("adding default value for itemKeys.title.autocompleteSort = %r\n" % key['autocompleteSort'])
|
||||||
|
|
||||||
old_formats = getattr(settings, 'CONFIG', {}).get('video', {}).get('formats', [])
|
old_formats = getattr(settings, 'CONFIG', {}).get('video', {}).get('formats', [])
|
||||||
formats = config.get('video', {}).get('formats')
|
formats = config.get('video', {}).get('formats')
|
||||||
if set(old_formats) != set(formats):
|
if set(old_formats) != set(formats):
|
||||||
|
|
Loading…
Reference in a new issue