From 500de93b5301dd918c92c933ed6fdedb5a0e6233 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 20 Dec 2011 03:29:38 +0530 Subject: [PATCH] do not play same video at the gap --- pandora/tv/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/tv/models.py b/pandora/tv/models.py index d0e0c1b1..abc0181b 100644 --- a/pandora/tv/models.py +++ b/pandora/tv/models.py @@ -37,6 +37,8 @@ class Channel(models.Model): self.run += 1 self.save() not_played = items + if not_played.count() > 1: + not_played = not_played.exclude(id=program[0].id) not_played_count = not_played.count() item = not_played[randint(0, not_played_count-1)] if program.count() > 0: