Merge branch 'master' of dev.sourcefabric.org:airtime
This commit is contained in:
commit
35c8e80f6b
|
@ -67,6 +67,11 @@ class Application_Service_CalendarService
|
||||||
"name"=> $text,
|
"name"=> $text,
|
||||||
"icon" => "soundcloud");
|
"icon" => "soundcloud");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$menu["content"] = array(
|
||||||
|
"name"=> _("Show Content"),
|
||||||
|
"icon" => "overview",
|
||||||
|
"url" => $baseUrl."schedule/show-content-dialog");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Show content can be modified from the calendar if:
|
//Show content can be modified from the calendar if:
|
||||||
|
|
|
@ -68,8 +68,12 @@ class Application_Service_SchedulerService
|
||||||
$ccSchedules = CcScheduleQuery::create()
|
$ccSchedules = CcScheduleQuery::create()
|
||||||
->filterByDbInstanceId($instanceIds, Criteria::IN)
|
->filterByDbInstanceId($instanceIds, Criteria::IN)
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
|
$interval = new DateInterval("PT".abs($diff)."S");
|
||||||
|
if ($diff < 0) {
|
||||||
|
$interval->invert = 1;
|
||||||
|
}
|
||||||
foreach ($ccSchedules as $ccSchedule) {
|
foreach ($ccSchedules as $ccSchedule) {
|
||||||
$interval = new DateInterval("PT".$diff."S");
|
|
||||||
$start = new DateTime($ccSchedule->getDbStarts());
|
$start = new DateTime($ccSchedule->getDbStarts());
|
||||||
$newStart = $start->add($interval);
|
$newStart = $start->add($interval);
|
||||||
$end = new DateTime($ccSchedule->getDbEnds());
|
$end = new DateTime($ccSchedule->getDbEnds());
|
||||||
|
|
|
@ -3,3 +3,11 @@ INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '2.4.0');
|
||||||
|
|
||||||
DELETE FROM cc_pref WHERE keystr = 'stream_type';
|
DELETE FROM cc_pref WHERE keystr = 'stream_type';
|
||||||
INSERT INTO cc_pref (keystr, valstr) VALUES ('stream_type', 'ogg, mp3, opus, aac');
|
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);
|
||||||
|
|
|
@ -10,7 +10,11 @@ ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
||||||
|
|
||||||
export PYTHONPATH=${api_client_path}
|
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
|
python generate_liquidsoap_cfg.py
|
||||||
|
|
||||||
exec ${ls_path} ${ls_param} 2>&1
|
exec ${ls_path} ${ls_param} 2>&1
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
from api_clients.api_client import AirtimeApiClient
|
from api_clients.api_client import AirtimeApiClient
|
||||||
|
|
||||||
def generate_liquidsoap_config(ss):
|
def generate_liquidsoap_config(ss):
|
||||||
|
@ -26,10 +27,19 @@ def generate_liquidsoap_config(ss):
|
||||||
|
|
||||||
logging.basicConfig(format='%(message)s')
|
logging.basicConfig(format='%(message)s')
|
||||||
ac = AirtimeApiClient(logging.getLogger())
|
ac = AirtimeApiClient(logging.getLogger())
|
||||||
try:
|
attempts = 0
|
||||||
ss = ac.get_stream_setting()
|
max_attempts = 5
|
||||||
generate_liquidsoap_config(ss)
|
|
||||||
except Exception, e:
|
while True:
|
||||||
logging.error(str(e))
|
try:
|
||||||
print "Unable to connect to the Airtime server."
|
ss = ac.get_stream_setting()
|
||||||
sys.exit(1)
|
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
|
||||||
|
|
Loading…
Reference in New Issue