From 103f3396d659a78380253203327ccef48edac39a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 18 Sep 2012 11:35:16 +0200 Subject: [PATCH] only play items with duration --- pandora/tv/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/tv/models.py b/pandora/tv/models.py index 551e398f..3396c587 100644 --- a/pandora/tv/models.py +++ b/pandora/tv/models.py @@ -25,9 +25,9 @@ class Channel(models.Model): now = datetime.now() cansee = settings.CONFIG['capabilities']['canSeeItem']['guest'] if self.list: - items = self.list.get_items(self.list.user).filter(rendered=True, level__lte=cansee) + items = self.list.get_items(self.list.user).filter(rendered=True, level__lte=cansee, sort__duration__gt=0) else: - items = Item.objects.filter(rendered=True, level__lte=cansee) + items = Item.objects.filter(rendered=True, level__lte=cansee, sort__duration__gt=0) if items.count() == 0: return {} @@ -53,7 +53,7 @@ class Channel(models.Model): p.item = item p.run = self.run p.start = start - p.end = start + timedelta(seconds=item.get_json()['duration']) + p.end = start + timedelta(seconds=item.sort.duration) p.channel = self p.save() program = self.program.order_by('-start')