make folderdepth part of config

This commit is contained in:
j 2013-02-04 18:37:26 +05:30
parent cd43bc2135
commit 98adab1259
2 changed files with 3 additions and 4 deletions

View file

@ -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']:

View file

@ -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'])