add migration for autocompleteSort

This commit is contained in:
j 2013-07-22 13:34:57 +00:00
parent ab75b70c5b
commit 117d2a504d
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import ox.jsonc
from ox.utils import json
from archive.extract import supported_formats, AVCONV
from item.utils import get_by_id
_win = (sys.platform == "win32")
@ -85,6 +86,11 @@ def load_config():
section, key, str(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', [])
formats = config.get('video', {}).get('formats')
if set(old_formats) != set(formats):