forked from 0x2620/pandora
no more auto, seriesYear
This commit is contained in:
parent
a1a8c0b428
commit
1bbfa6e0c8
2 changed files with 4 additions and 4 deletions
|
@ -133,7 +133,7 @@ class File(models.Model):
|
||||||
data = ox.movie.parse_path(path)
|
data = ox.movie.parse_path(path)
|
||||||
for key in (
|
for key in (
|
||||||
'normalizedPath', 'isEpisode',
|
'normalizedPath', 'isEpisode',
|
||||||
'title', 'director', 'year',
|
'title', 'director', 'directorSort', 'year',
|
||||||
'season', 'episode', 'episodeTitle',
|
'season', 'episode', 'episodeTitle',
|
||||||
'seriesTitle', 'seriesYear'
|
'seriesTitle', 'seriesYear'
|
||||||
):
|
):
|
||||||
|
@ -152,6 +152,8 @@ class File(models.Model):
|
||||||
data['isEpisode'] = data.get('season') != None \
|
data['isEpisode'] = data.get('season') != None \
|
||||||
or data.get('episode') != None \
|
or data.get('episode') != None \
|
||||||
or data.get('episodes') != []
|
or data.get('episodes') != []
|
||||||
|
if data['isEpisode'] and data['seriesYear'] == None:
|
||||||
|
data['seriesYear'] = data['year']
|
||||||
data['type'] = 'unknown'
|
data['type'] = 'unknown'
|
||||||
for type in ox.movie.EXTENSIONS:
|
for type in ox.movie.EXTENSIONS:
|
||||||
if data['extension'] in ox.movie.EXTENSIONS[type]:
|
if data['extension'] in ox.movie.EXTENSIONS[type]:
|
||||||
|
|
|
@ -354,7 +354,6 @@ def editFiles(request):
|
||||||
if True:
|
if True:
|
||||||
if 'ignore' in data:
|
if 'ignore' in data:
|
||||||
models.Instance.objects.filter(file__in=files).update(ignore=data['ignore'])
|
models.Instance.objects.filter(file__in=files).update(ignore=data['ignore'])
|
||||||
files.update(auto=True)
|
|
||||||
#FIXME: is this to slow to run sync?
|
#FIXME: is this to slow to run sync?
|
||||||
for i in Item.objects.filter(files__in=files).distinct():
|
for i in Item.objects.filter(files__in=files).distinct():
|
||||||
i.update_selected()
|
i.update_selected()
|
||||||
|
@ -396,7 +395,6 @@ def editFile(request):
|
||||||
update = False
|
update = False
|
||||||
#FIXME: should all instances be ignored?
|
#FIXME: should all instances be ignored?
|
||||||
if 'ignore' in data:
|
if 'ignore' in data:
|
||||||
f.auto = True
|
|
||||||
f.instances.update(ignore=data['ignore'])
|
f.instances.update(ignore=data['ignore'])
|
||||||
f.save()
|
f.save()
|
||||||
#FIXME: is this to slow to run sync?
|
#FIXME: is this to slow to run sync?
|
||||||
|
@ -449,7 +447,7 @@ def getPath(request):
|
||||||
ids = data['id']
|
ids = data['id']
|
||||||
if isinstance(ids, basestring):
|
if isinstance(ids, basestring):
|
||||||
ids = [ids]
|
ids = [ids]
|
||||||
for f in models.File.objects.filter(oshash__in=ids).values('path', 'oshash'):
|
for f in models.File.objects.filter(oshash__in=ids).values('path', 'oshash').order_by('sort_path'):
|
||||||
response['data'][f['oshash']] = f['path']
|
response['data'][f['oshash']] = f['path']
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(getPath, cache=True)
|
actions.register(getPath, cache=True)
|
||||||
|
|
Loading…
Reference in a new issue