From 1502a5992eb847cfbd492061cc136e09cb12873c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 30 May 2013 11:49:31 +0000 Subject: [PATCH] allow ignoring only available file --- pandora/item/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index ba9a9034..5e804c14 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1008,7 +1008,8 @@ class Item(models.Model): self.files.exclude(id__in=wanted).update(wanted=False) def update_selected(self): - for s in self.sets(): + sets = self.sets() + for s in sets: if s.filter(Q(is_video=True)|Q(is_audio=True)).filter(available=False).count() == 0: update = False self.files.exclude(id__in=s).exclude(part=None).update(part=None) @@ -1024,6 +1025,10 @@ class Item(models.Model): self.save() tasks.update_timeline.delay(self.itemId) break + if not sets: + self.rendered = False + self.files.filter(selected=True).update(selected=False) + self.save() def get_torrent(self, request): if self.torrent: