From 98adab1259c931c25d773a20c96d0e4c2a46002b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 4 Feb 2013 18:37:26 +0530 Subject: [PATCH] make folderdepth part of config --- pandora/app/config.py | 2 ++ pandora/archive/tasks.py | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora/app/config.py b/pandora/app/config.py index 909df83e..212770fb 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -46,6 +46,8 @@ def load_config(): settings.SERVER_EMAIL = config['site']['email']['system'] config['site']['videoprefix'] = settings.VIDEO_PREFIX config['site']['version'] = get_version() + if not 'folderdepth' in config['site']: + config['site']['folderdepth'] = settings.USE_IMDB and 4 or 3 config['keys'] = {} for key in config['itemKeys']: diff --git a/pandora/archive/tasks.py b/pandora/archive/tasks.py index 71cad8ec..692e3a55 100644 --- a/pandora/archive/tasks.py +++ b/pandora/archive/tasks.py @@ -74,10 +74,7 @@ def update_files(user, volume, files): user = models.User.objects.get(username=user) volume, created = models.Volume.objects.get_or_create(user=user, name=volume) all_files = [] - #ignore extras etc, - #imdb stlye is L/Last, First/Title (Year)/Title.. 4 - #otherwise T/Title (Year)/Title... 3 - folder_depth = settings.USE_IMDB and 4 or 3 + folder_depth = settings.CONFIG['site']['folderdepth'] for f in files: if len(f['path'].split('/')) == folder_depth: all_files.append(f['oshash'])