From 117d2a504d14162ee52f50c736bd3b35611616c5 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 22 Jul 2013 13:34:57 +0000 Subject: [PATCH] add migration for autocompleteSort --- pandora/app/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora/app/config.py b/pandora/app/config.py index 2b69b825..f9bf0629 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -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):