From 03b32ea986f29de48730c89911bb5f92e47f646d Mon Sep 17 00:00:00 2001 From: James Date: Tue, 16 Oct 2012 10:37:42 -0400 Subject: [PATCH 1/3] CC-4563 Library: Exception is found when remove a block by context menu - fixed --- airtime_mvc/public/js/airtime/library/library.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 161d18d45..a832134c1 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -815,9 +815,10 @@ var AIRTIME = (function(AIRTIME) { //playlist screen if this is the currently edited playlist. if ((data.ftype === "playlist" || data.ftype === "block") && screen === "playlist") { callback = function() { - + aMedia = []; + aMedia.push({"id": data.id, "type": data.ftype}); if (confirm('Are you sure you want to delete the selected item?')) { - AIRTIME.playlist.fnDelete(data.id); + AIRTIME.library.fnDeleteItems(aMedia); } }; } From 8a93717415915f4a17187191c876e37b29407134 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 16 Oct 2012 11:06:01 -0400 Subject: [PATCH 2/3] CC-4568: Show preview broken in Now Playing page - fixed --- .../application/controllers/AudiopreviewController.php | 1 + airtime_mvc/application/models/ShowInstance.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/controllers/AudiopreviewController.php b/airtime_mvc/application/controllers/AudiopreviewController.php index bd7505595..3718a86a0 100644 --- a/airtime_mvc/application/controllers/AudiopreviewController.php +++ b/airtime_mvc/application/controllers/AudiopreviewController.php @@ -278,6 +278,7 @@ class AudiopreviewController extends Zend_Controller_Action 'element_artist' => isset($track['creator']) ? $track['creator'] : "", 'element_position' => $position, 'element_id' => ++$position, + 'mime' => isset($track['mime'])?$track['mime']:"" ); $elementMap['type'] = $track['type']; diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index b08a0e37c..6a513aac4 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -677,7 +677,8 @@ FROM ( f.length AS length, f.artist_name AS creator, f.file_exists AS EXISTS, - f.filepath AS filepath + f.filepath AS filepath, + f.mime AS mime FROM cc_schedule AS s LEFT JOIN cc_files AS f ON f.id = s.file_id WHERE s.instance_id = :instance_id1 @@ -693,7 +694,8 @@ FROM ( ws.length AS length, sub.login AS creator, 't'::boolean AS EXISTS, - ws.url AS filepath + ws.url AS filepath, + ws.mime as mime FROM cc_schedule AS s LEFT JOIN cc_webstream AS ws ON ws.id = s.stream_id LEFT JOIN cc_subjs AS sub ON ws.creator_id = sub.id From a92956108860855588867dc2d34dbd366649fc8c Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 16 Oct 2012 11:59:37 -0400 Subject: [PATCH 3/3] CC-4565: Pypopush: Error happens when trying to insert a song right behind a Webstream as well as that Webstream is just finished -make sure we don't return a negative when calculating interval seconds --- python_apps/pypo/pypopush.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index aaacc1687..87e1704bf 100644 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -399,7 +399,15 @@ class PypoPush(Thread): def date_interval_to_seconds(self, interval): - return (interval.microseconds + (interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6) + """ + Convert timedelta object into int representing the number of seconds. If + number of seconds is less than 0, then return 0. + """ + seconds = (interval.microseconds + \ + (interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6) + if seconds < 0: seconds = 0 + + return seconds def push_to_liquidsoap(self, event_chain):