From a09a31bc8871632abc91dda29321989d65cdeab4 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 10 Apr 2012 23:13:52 -0400 Subject: [PATCH 1/3] CC-3610: Now Playing ->songs in the Now Playing do not reflect the changes affected changed END_OF_SHOW -pypo side fixed --- airtime_mvc/application/models/Schedule.php | 11 ++++++++--- python_apps/pypo/pypopush.py | 11 +++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index ad9a31089..577ea702b 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -524,12 +524,13 @@ class Application_Model_Schedule { foreach ($items as $item){ - $storedFile = Application_Model_StoredFile::Recall($item["file_id"]); - $uri = $storedFile->getFilePath(); - $showEndDateTime = new DateTime($item["show_end"], $utcTimeZone); $trackStartDateTime = new DateTime($item["start"], $utcTimeZone); $trackEndDateTime = new DateTime($item["end"], $utcTimeZone); + + if ($trackStartDateTime->getTimestamp() > $showEndDateTime->getTimestamp()){ + continue; + } /* Note: cue_out and end are always the same. */ /* TODO: Not all tracks will have "show_end" */ @@ -537,8 +538,12 @@ class Application_Model_Schedule { $di = $trackStartDateTime->diff($showEndDateTime); $item["cue_out"] = $di->format("%H:%i:%s").".000"; + $item["end"] = $showEndDateTime->format("Y-m-d H:i:s"); } + $storedFile = Application_Model_StoredFile::Recall($item["file_id"]); + $uri = $storedFile->getFilePath(); + $start = Application_Model_Schedule::AirtimeTimeToPypoTime($item["start"]); $data["media"][$start] = array( 'id' => $storedFile->getGunid(), diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index 396302754..0a6bde357 100644 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -173,6 +173,7 @@ class PypoPush(Thread): if problem_at_iteration is not None: self.logger.debug("Change in chain at link %s", problem_at_iteration) + self.modify_cue_point_of_first_link(current_chain) self.push_to_liquidsoap(current_chain[problem_at_iteration:]) @@ -249,11 +250,13 @@ class PypoPush(Thread): link_start = datetime.strptime(link['start'], "%Y-%m-%d-%H-%M-%S") diff_td = tnow - link_start + diff_sec = self.convert_timedelta_to_seconds(diff_td) - self.logger.debug("media item was supposed to start %s ago. Preparing to start..", diff_td) - original_cue_in_td = timedelta(seconds=float(link['cue_in'])) - link['cue_in'] = self.convert_timedelta_to_seconds(original_cue_in_td + diff_td) - + if diff_sec > 0: + self.logger.debug("media item was supposed to start %s ago. Preparing to start..", diff_sec) + original_cue_in_td = timedelta(seconds=float(link['cue_in'])) + link['cue_in'] = self.convert_timedelta_to_seconds(original_cue_in_td) + diff_sec + def convert_timedelta_to_seconds(self, td): return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 From 26d13e7184c3452a28b396feb855ba0a73149944 Mon Sep 17 00:00:00 2001 From: Denise Rigato Date: Wed, 11 Apr 2012 11:01:22 -0400 Subject: [PATCH 2/3] CC-3468: Stream settings: Need detailed tooltip for "override" fields -fixed --- .../application/views/scripts/form/preferences_livestream.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml index d89021b2c..37459635b 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml @@ -79,7 +79,7 @@ master_dj_connection_url ?> override   - This is the URL to display to DJs who would like to connect a stream to Airtime. If Airtime is behind a router or firewall, you will need to use port forwarding on the router to forward connections to the ports that you configure here. For more detailed information on what this means, click here. + This is the URL used by remote sources to connect to Airtime. If Airtime is behind a router or firewall, you may need to configure port forwarding. For details, please read the Airtime manual.
From 92f057593eb806e300311436ee5e23fec3e6d4f9 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 11 Apr 2012 11:21:51 -0400 Subject: [PATCH 3/3] CC-3428: liquidsoap seems to have troubles with this file -need to escape double quotes not single :P --- .../media-monitor/airtimefilemonitor/mediamonitorcommon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py b/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py index ea2c4fe79..2852cec45 100644 --- a/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py +++ b/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py @@ -298,7 +298,7 @@ def test_file_playability(pathname): """ liquidsoap_found = subprocess.call("which liquidsoap", shell=True) if liquidsoap_found == 0: - return_code = subprocess.call("liquidsoap -r \"%s\"" % pathname.replace("'", "\\'"), shell=True) + return_code = subprocess.call("liquidsoap -r \"%s\"" % pathname.replace('"', '\\"'), shell=True) else: return_code = 0