diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 9b064f8a5..a4fae2966 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -133,7 +133,7 @@ class File(models.Model): data = ox.movie.parse_path(path) for key in ( 'normalizedPath', 'isEpisode', - 'title', 'director', 'year', + 'title', 'director', 'directorSort', 'year', 'season', 'episode', 'episodeTitle', 'seriesTitle', 'seriesYear' ): @@ -152,6 +152,8 @@ class File(models.Model): data['isEpisode'] = data.get('season') != None \ or data.get('episode') != None \ or data.get('episodes') != [] + if data['isEpisode'] and data['seriesYear'] == None: + data['seriesYear'] = data['year'] data['type'] = 'unknown' for type in ox.movie.EXTENSIONS: if data['extension'] in ox.movie.EXTENSIONS[type]: diff --git a/pandora/archive/views.py b/pandora/archive/views.py index ff27cf78b..8ecb79bf2 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -354,7 +354,6 @@ def editFiles(request): if True: if 'ignore' in data: models.Instance.objects.filter(file__in=files).update(ignore=data['ignore']) - files.update(auto=True) #FIXME: is this to slow to run sync? for i in Item.objects.filter(files__in=files).distinct(): i.update_selected() @@ -396,7 +395,6 @@ def editFile(request): update = False #FIXME: should all instances be ignored? if 'ignore' in data: - f.auto = True f.instances.update(ignore=data['ignore']) f.save() #FIXME: is this to slow to run sync? @@ -449,7 +447,7 @@ def getPath(request): ids = data['id'] if isinstance(ids, basestring): 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'] return render_to_json_response(response) actions.register(getPath, cache=True)