allow ignoring only available file

This commit is contained in:
j 2013-05-30 11:49:31 +00:00
parent a05c79b59a
commit 1502a5992e

View file

@ -1008,7 +1008,8 @@ class Item(models.Model):
self.files.exclude(id__in=wanted).update(wanted=False) self.files.exclude(id__in=wanted).update(wanted=False)
def update_selected(self): 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: if s.filter(Q(is_video=True)|Q(is_audio=True)).filter(available=False).count() == 0:
update = False update = False
self.files.exclude(id__in=s).exclude(part=None).update(part=None) self.files.exclude(id__in=s).exclude(part=None).update(part=None)
@ -1024,6 +1025,10 @@ class Item(models.Model):
self.save() self.save()
tasks.update_timeline.delay(self.itemId) tasks.update_timeline.delay(self.itemId)
break break
if not sets:
self.rendered = False
self.files.filter(selected=True).update(selected=False)
self.save()
def get_torrent(self, request): def get_torrent(self, request):
if self.torrent: if self.torrent: