forked from 0x2620/pandora
make folderdepth part of config
This commit is contained in:
parent
cd43bc2135
commit
98adab1259
2 changed files with 3 additions and 4 deletions
|
@ -46,6 +46,8 @@ def load_config():
|
||||||
settings.SERVER_EMAIL = config['site']['email']['system']
|
settings.SERVER_EMAIL = config['site']['email']['system']
|
||||||
config['site']['videoprefix'] = settings.VIDEO_PREFIX
|
config['site']['videoprefix'] = settings.VIDEO_PREFIX
|
||||||
config['site']['version'] = get_version()
|
config['site']['version'] = get_version()
|
||||||
|
if not 'folderdepth' in config['site']:
|
||||||
|
config['site']['folderdepth'] = settings.USE_IMDB and 4 or 3
|
||||||
|
|
||||||
config['keys'] = {}
|
config['keys'] = {}
|
||||||
for key in config['itemKeys']:
|
for key in config['itemKeys']:
|
||||||
|
|
|
@ -74,10 +74,7 @@ def update_files(user, volume, files):
|
||||||
user = models.User.objects.get(username=user)
|
user = models.User.objects.get(username=user)
|
||||||
volume, created = models.Volume.objects.get_or_create(user=user, name=volume)
|
volume, created = models.Volume.objects.get_or_create(user=user, name=volume)
|
||||||
all_files = []
|
all_files = []
|
||||||
#ignore extras etc,
|
folder_depth = settings.CONFIG['site']['folderdepth']
|
||||||
#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
|
|
||||||
for f in files:
|
for f in files:
|
||||||
if len(f['path'].split('/')) == folder_depth:
|
if len(f['path'].split('/')) == folder_depth:
|
||||||
all_files.append(f['oshash'])
|
all_files.append(f['oshash'])
|
||||||
|
|
Loading…
Reference in a new issue