From e5e0c925e673ef4c4717a3ae00d3dea7a913f962 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 29 Jun 2012 12:11:38 -0400 Subject: [PATCH] CC-4043: Pypo: add same song twice and cancel the first song, the following song wont play any more - fixed --- python_apps/pypo/pypofile.py | 4 ++++ python_apps/pypo/pypopush.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/python_apps/pypo/pypofile.py b/python_apps/pypo/pypofile.py index 6f9a213e6..cf8e199e9 100644 --- a/python_apps/pypo/pypofile.py +++ b/python_apps/pypo/pypofile.py @@ -60,10 +60,14 @@ class PypoFile(Thread): except Exception, e: dst_exists = False + media_item['already_exist'] = False do_copy = False if dst_exists: if src_size != dst_size: do_copy = True + else: + self.logger.debug("file %s already exists in local cache as %s, skipping cpoying..." % (src, dst)) + media_item['already_exist'] = True else: do_copy = True diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index 347b856fa..cb71937a3 100644 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -344,7 +344,7 @@ class PypoPush(Thread): time.sleep(0.1) iter_num += 1 - if media_item['started_copying']: + if media_item['started_copying'] or media_item['already_exist']: self.telnet_to_liquidsoap(media_item) else: self.logger.warn("File %s did not become ready in less than 5 seconds. Skipping...", media_item['dst'])