From 6fddabdd7c1f12ec7b94dea1246c38d8989bf0ad Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 30 May 2013 14:02:05 -0400 Subject: [PATCH] CC-5192 Pypo: Live Streaming in first show will block the next show's first track -fixed. Was caused by clashing keys --- python_apps/pypo/pypofetch.py | 8 +++++--- python_apps/pypo/pypoliqqueue.py | 6 ++++-- python_apps/pypo/pypopush.py | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index 22455c505..6c3344248 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -441,9 +441,11 @@ class PypoFetch(Thread): media_item['file_ready'] = False media_filtered[key] = media_item - media_item['start'] = datetime.strptime(media_item['start'], "%Y-%m-%d-%H-%M-%S") - media_item['end'] = datetime.strptime(media_item['end'], "%Y-%m-%d-%H-%M-%S") - media_copy[media_item['start']] = media_item + media_item['start'] = datetime.strptime(media_item['start'], + "%Y-%m-%d-%H-%M-%S") + media_item['end'] = datetime.strptime(media_item['end'], + "%Y-%m-%d-%H-%M-%S") + media_copy[key] = media_item self.media_prepare_queue.put(copy.copy(media_filtered)) diff --git a/python_apps/pypo/pypoliqqueue.py b/python_apps/pypo/pypoliqqueue.py index a5e50831e..8f664c7d7 100644 --- a/python_apps/pypo/pypoliqqueue.py +++ b/python_apps/pypo/pypoliqqueue.py @@ -61,8 +61,10 @@ class PypoLiqQueue(Thread): schedule_deque.append(media_schedule[i]) if len(keys): - time_until_next_play = self.date_interval_to_seconds(\ - keys[0] - datetime.utcnow()) + time_until_next_play = self.date_interval_to_seconds( + media_schedule[keys[0]]['start'] - + datetime.utcnow()) + else: time_until_next_play = None diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index d032ac3c6..071936a68 100644 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -110,7 +110,7 @@ class PypoPush(Thread): if diff_sec >= 0: present.append(media_item) else: - future[media_item['start']] = media_item + future[mkey] = media_item return present, future