better streams query

This commit is contained in:
j 2011-08-27 12:54:39 +02:00
parent a957e3b9ad
commit 2406e0394e

View file

@ -839,8 +839,8 @@ class Item(models.Model):
self.save() self.save()
def streams(self): def streams(self):
return [video.streams.filter(source=None, available=True)[0] return archive.models.Stream.objects.filter(source=None, available=True,
for video in self.files.filter(is_video=True, active=True).order_by('part')] file__item=self, file__is_video=True, file__active=True).order_by('file__part')
def update_timeline(self, force=False): def update_timeline(self, force=False):
config = site_config() config = site_config()