save info into right place

This commit is contained in:
j 2013-02-08 17:51:12 +00:00
parent bf1a4102c1
commit 2bb7fe3a75
2 changed files with 4 additions and 5 deletions

View file

@ -151,11 +151,11 @@ class File(models.Model):
data['directorSort'] = [get_name_sort(n) for n in self.item.get('director', [])]
data['isEpisode'] = data.get('season') != None \
or data.get('episode') != None \
or data.get('episodes') != []
or data.get('episodes') not in ([], None)
if data['isEpisode'] and data['seriesYear'] == None:
data['seriesYear'] = data['year']
data['type'] = 'unknown'
if 'extension' in data:
if 'extension' in data and data['extension']:
data['extension'] = data['extension'].lower()
for type in ox.movie.EXTENSIONS:
if data['extension'] in ox.movie.EXTENSIONS[type]:

View file

@ -95,7 +95,6 @@ def update(request):
files = all_files.filter(file__available=False)
if volume:
files = files.filter(volume=volume)
#fixme: might be better to check for file__path_info
response['data']['info'] = [f.file.oshash for f in all_files.filter(file__info='{}')]
response['data']['data'] = [f.file.oshash for f in files.filter(file__is_video=True,
file__available=False,
@ -369,9 +368,9 @@ def editFiles(request):
else:
dont_ignore.append(info['id'])
update = False
for key in ('episodes', 'extension', 'language', 'part', 'partTitle', 'version'):
for key in f.PATH_INFO:
if key in info:
f.path_info[key] = info[key]
f.info[key] = info[key]
update = True
if update:
f.save()