From 597fe9d6c696475079bb19d416aed92accdd9b38 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 9 Nov 2012 12:07:38 +0100 Subject: [PATCH] always request info for all files that need it --- pandora/archive/views.py | 5 +++-- pandora/item/models.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 8ecb79bf2..53630ef6f 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -94,10 +94,11 @@ def update(request): f.info = info f.save() if not upload_only: - files = models.Instance.objects.filter(volume__user=user, file__available=False) + all_files = models.Instance.objects.filter(volume__user=user) + files = all_files.filter(file__avalable=False) if volume: files = files.filter(volume=volume) - response['data']['info'] = [f.file.oshash for f in files.filter(file__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, file__wanted=True)] diff --git a/pandora/item/models.py b/pandora/item/models.py index 2947423be..7214bd8b3 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -780,7 +780,7 @@ class Item(models.Model): s.resolution = v.width * v.height s.width = v.width s.height = v.height - if not s.aspectratio: + if not s.aspectratio and v.display_aspect_ratio: s.aspectratio = float(utils.parse_decimal(v.display_aspect_ratio)) s.pixels = sum([v.pixels for v in videos]) s.numberoffiles = self.files.all().count()