From 2d7def5c0556ab31938acba32464a65e7e4ebf57 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 25 Aug 2013 14:54:30 +0200 Subject: [PATCH] always update numberoffiles --- pandora/item/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 4498cfad7..4bde18289 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -828,6 +828,7 @@ class Item(models.Model): s.words = sum([len(a.value.split()) for a in self.annotations.exclude(value='')]) s.clips = self.clips.count() + s.numberoffiles = self.files.all().count() videos = self.files.filter(selected=True).filter(Q(is_video=True)|Q(is_audio=True)) if videos.count() > 0: s.duration = sum([v.duration for v in videos]) @@ -843,7 +844,6 @@ class Item(models.Model): 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() s.parts = videos.count() s.size = sum([v.size for v in videos]) #FIXME: only size of movies? if s.duration: