From d8ba15fac4dd72abb8d266f54032c2807359bec5 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 8 May 2013 12:05:45 -0400 Subject: [PATCH 1/4] CC-5091: Linked Show: Cannot change the start time ahead --- airtime_mvc/application/services/SchedulerService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/services/SchedulerService.php b/airtime_mvc/application/services/SchedulerService.php index 2cf5711fc..7fe3ca6f8 100644 --- a/airtime_mvc/application/services/SchedulerService.php +++ b/airtime_mvc/application/services/SchedulerService.php @@ -68,8 +68,12 @@ class Application_Service_SchedulerService $ccSchedules = CcScheduleQuery::create() ->filterByDbInstanceId($instanceIds, Criteria::IN) ->find(); + + $interval = new DateInterval("PT".abs($diff)."S"); + if ($diff < 0) { + $interval->invert = 1; + } foreach ($ccSchedules as $ccSchedule) { - $interval = new DateInterval("PT".$diff."S"); $start = new DateTime($ccSchedule->getDbStarts()); $newStart = $start->add($interval); $end = new DateTime($ccSchedule->getDbEnds()); From fae0b2f873511d755e3492f350121953aa9df02e Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 8 May 2013 13:11:30 -0400 Subject: [PATCH 2/4] CC-5111: Please make upgrade detect the tracks already scheduled and added in playlist --- install_minimal/upgrades/airtime-2.4.0/data/upgrade.sql | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install_minimal/upgrades/airtime-2.4.0/data/upgrade.sql b/install_minimal/upgrades/airtime-2.4.0/data/upgrade.sql index 4b091c618..9474f5d37 100644 --- a/install_minimal/upgrades/airtime-2.4.0/data/upgrade.sql +++ b/install_minimal/upgrades/airtime-2.4.0/data/upgrade.sql @@ -3,3 +3,11 @@ INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '2.4.0'); DELETE FROM cc_pref WHERE keystr = 'stream_type'; INSERT INTO cc_pref (keystr, valstr) VALUES ('stream_type', 'ogg, mp3, opus, aac'); + +UPDATE cc_files +SET is_scheduled = true +WHERE id IN (SELECT DISTINCT(file_id) FROM cc_schedule WHERE playout_status != -1); + +UPDATE cc_files +SET is_playlist = true +WHERE id IN (SELECT DISTINCT(file_id) FROM cc_playlistcontents); From 9dbec4636ac070d50416043bde12a85a4b8f7c40 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 8 May 2013 13:43:27 -0400 Subject: [PATCH 3/4] CC-5106: Calendar: Context menu "Show contents" is missing for past shows --- airtime_mvc/application/services/CalendarService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php index 1c963fc45..0db7d4e2d 100644 --- a/airtime_mvc/application/services/CalendarService.php +++ b/airtime_mvc/application/services/CalendarService.php @@ -67,6 +67,11 @@ class Application_Service_CalendarService "name"=> $text, "icon" => "soundcloud"); } + } else { + $menu["content"] = array( + "name"=> _("Show Content"), + "icon" => "overview", + "url" => $baseUrl."schedule/show-content-dialog"); } } else { //Show content can be modified from the calendar if: From f0e846db75fef4fe84beb8511a30635ff5522455 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 8 May 2013 13:47:24 -0400 Subject: [PATCH 4/4] CC-5049: Error messages on Liquidsoap start up/shut down after Airtime install fixed --- python_apps/pypo/airtime-liquidsoap | 6 ++++- .../generate_liquidsoap_cfg.py | 24 +++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/python_apps/pypo/airtime-liquidsoap b/python_apps/pypo/airtime-liquidsoap index 259ff4646..0812bd47d 100755 --- a/python_apps/pypo/airtime-liquidsoap +++ b/python_apps/pypo/airtime-liquidsoap @@ -10,7 +10,11 @@ ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq" export PYTHONPATH=${api_client_path} -cd /usr/lib/airtime/pypo/bin/liquidsoap_scripts +SCRIPT=`readlink -f $0` +# Absolute directory this script is in +SCRIPTPATH=`dirname $SCRIPT` + +cd $SCRIPTPATH/liquidsoap_scripts python generate_liquidsoap_cfg.py exec ${ls_path} ${ls_param} 2>&1 diff --git a/python_apps/pypo/liquidsoap_scripts/generate_liquidsoap_cfg.py b/python_apps/pypo/liquidsoap_scripts/generate_liquidsoap_cfg.py index b123763e2..6144058e0 100644 --- a/python_apps/pypo/liquidsoap_scripts/generate_liquidsoap_cfg.py +++ b/python_apps/pypo/liquidsoap_scripts/generate_liquidsoap_cfg.py @@ -1,5 +1,6 @@ import logging import sys +import time from api_clients.api_client import AirtimeApiClient def generate_liquidsoap_config(ss): @@ -26,10 +27,19 @@ def generate_liquidsoap_config(ss): logging.basicConfig(format='%(message)s') ac = AirtimeApiClient(logging.getLogger()) -try: - ss = ac.get_stream_setting() - generate_liquidsoap_config(ss) -except Exception, e: - logging.error(str(e)) - print "Unable to connect to the Airtime server." - sys.exit(1) +attempts = 0 +max_attempts = 5 + +while True: + try: + ss = ac.get_stream_setting() + generate_liquidsoap_config(ss) + break + except Exception, e: + if attempts == max_attempts: + print "Unable to connect to the Airtime server." + logging.error(str(e)) + sys.exit(1) + else: + time.sleep(3) + attempts += 1