Merge branch '2.0.x' of dev.sourcefabric.org:airtime into 2.0.x
This commit is contained in:
commit
68bec7ac1b
7 changed files with 35 additions and 167 deletions
|
@ -215,7 +215,8 @@ class ApiController extends Zend_Controller_Action
|
|||
"currentShow"=>Application_Model_Show::GetCurrentShow($utcTimeNow),
|
||||
"nextShow"=>Application_Model_Show::GetNextShows($utcTimeNow, $limit, $utcTimeEnd),
|
||||
"timezone"=> date("T"),
|
||||
"timezoneOffset"=> date("Z"));
|
||||
"timezoneOffset"=> date("Z"),
|
||||
"widgetVersion"=>"1.0"); //used by caller to determine if the airtime they are running or widgets in use is out of date.
|
||||
|
||||
//Convert from UTC to localtime for user.
|
||||
Application_Model_Show::ConvertToLocalTimeZone($result["currentShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
|
||||
|
@ -254,7 +255,7 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
$result[$dow[$i]] = $shows;
|
||||
}
|
||||
|
||||
$result['widgetVersion'] = "1.0"; //used by caller to determine if the airtime they are running or widgets in use is out of date.
|
||||
header("Content-type: text/javascript");
|
||||
echo $_GET['callback'].'('.json_encode($result).')';
|
||||
} else {
|
||||
|
|
|
@ -35,7 +35,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
|
||||
// Add artist field
|
||||
$this->addElement('text', 'artist_name', array(
|
||||
'label' => 'Artist:',
|
||||
'label' => 'Creator:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim'),
|
||||
));
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
#!/bin/bash -e
|
||||
#-e Causes bash script to exit if any of the installers
|
||||
#return with a non-zero return value.
|
||||
|
||||
if [ `whoami` != 'root' ]; then
|
||||
echo "Please run as root user."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set +e
|
||||
DEB=$(dpkg -s airtime 2> /dev/null | grep Status)
|
||||
set -e
|
||||
if [[ "$DEB" = "Status: install ok installed" ]]; then
|
||||
echo -e "\nDebian package of Airtime detected. Please use the debian package to upgrade.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
#Check whether version of virtualenv is <= 1.4.8. If so exit install.
|
||||
BAD_VERSION="1.4.8"
|
||||
VERSION=$(virtualenv --version)
|
||||
NEWEST_VERSION=$(echo -e "$BAD_VERSION\n$VERSION\n'" | sort -t '.' -g | tail -n 1)
|
||||
echo -n "Ensuring python-virtualenv version > $BAD_VERSION..."
|
||||
if [[ "$NEWEST_VERSION" = "$BAD_VERSION" ]]; then
|
||||
URL="http://apt.sourcefabric.org/pool/main/p/python-virtualenv/python-virtualenv_1.4.9-3_all.deb"
|
||||
echo "Failed!"
|
||||
echo "You have version $BAD_VERSION or older installed. Please install package at $URL first and then try installing Airtime again."
|
||||
exit 1
|
||||
else
|
||||
echo "Success!"
|
||||
fi
|
||||
|
||||
|
||||
echo -e "\n******************************** Install Begin *********************************"
|
||||
|
||||
# Absolute path to this script
|
||||
SCRIPT=`readlink -f $0`
|
||||
# Absolute directory this script is in
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
${SCRIPTPATH}/../python_apps/python-virtualenv/virtualenv-install.sh
|
||||
|
||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||
. ${virtualenv_bin}activate
|
||||
|
||||
echo -e "\n*** Creating Pypo User ***"
|
||||
python ${SCRIPTPATH}/../python_apps/create-pypo-user.py
|
||||
|
||||
set +e
|
||||
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-install.php $@
|
||||
result=$?
|
||||
|
||||
if [ "$result" -ne "0" ]; then
|
||||
#There was an error, exit with error code.
|
||||
echo "There was an error during upgrade. Exit code $result"
|
||||
exit 1
|
||||
fi
|
||||
set -e
|
||||
|
||||
echo -e "\n*** API Client Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_install.py
|
||||
|
||||
echo -e "\n*** Pypo Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-install.py
|
||||
|
||||
echo -e "\n*** Recorder Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
|
||||
|
||||
echo -e "\n*** Media Monitor Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
|
||||
|
||||
python ${SCRIPTPATH}/../python_apps/icecast2/install/icecast2-install.py
|
||||
|
||||
# Start monit if it is not running, or restart if it is.
|
||||
# Need to ensure monit is running before Airtime daemons are run. This is
|
||||
# so we can ensure they can register with monit to monitor them when they start.
|
||||
# If monit is already running, this step is still useful as we need monit to
|
||||
# reload its config files.
|
||||
/etc/init.d/monit restart
|
||||
|
||||
#give monit some time to boot-up before issuing commands
|
||||
sleep 1
|
||||
|
||||
set +e
|
||||
monit monitor airtime-media-monitor
|
||||
monit monitor airtime-liquidsoap
|
||||
monit monitor airtime-playout
|
||||
monit monitor airtime-show-recorder
|
||||
monit monitor rabbitmq-server
|
||||
set -e
|
||||
|
||||
echo -e "\n*** Verifying your system environment ***"
|
||||
sleep 10
|
||||
airtime-check-system
|
||||
|
||||
echo -e "\n******************************* Install Complete *******************************"
|
|
@ -1,56 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ `whoami` != 'root' ]; then
|
||||
echo "Please run as root user."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VIRTUAL_ENV_DIR="/usr/lib/airtime/airtime_virtualenv"
|
||||
if [ ! -d "$VIRTUAL_ENV_DIR" ]; then
|
||||
echo -e "\nAirtime is not installed, cannot uninstall.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||
. ${virtualenv_bin}activate
|
||||
|
||||
#Cause bash script to exit if any of the installers
|
||||
#return with a non-zero return value.
|
||||
set -e
|
||||
|
||||
# Absolute path to this script
|
||||
SCRIPT=`readlink -f $0`
|
||||
# Absolute directory this script is in
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
echo -e "\n******************************* Uninstall Begin ********************************"
|
||||
|
||||
set +e
|
||||
monit unmonitor rabbitmq-server >/dev/null 2>&1
|
||||
set -e
|
||||
|
||||
$SCRIPTPATH/include/airtime-uninitialize.sh
|
||||
$SCRIPTPATH/include/airtime-remove-files.sh
|
||||
|
||||
#echo -e "\n*** Uninstalling Pypo ***"
|
||||
#python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-uninstall.py
|
||||
|
||||
#echo -e "\n*** Uninstalling Show Recorder ***"
|
||||
#python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-uninstall.py
|
||||
|
||||
#echo -e "\n*** Uninstalling Media Monitor ***"
|
||||
#python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-uninstall.py
|
||||
|
||||
#echo -e "\n*** Uninstalling API Client ***"
|
||||
#python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_uninstall.py
|
||||
|
||||
|
||||
echo -e "\n*** Removing Pypo User ***"
|
||||
python ${SCRIPTPATH}/../python_apps/remove-pypo-user.py
|
||||
|
||||
#php ${SCRIPTPATH}/include/airtime-uninstall.php
|
||||
|
||||
echo -e "\n****************************** Uninstall Complete ******************************\n"
|
||||
echo "NOTE: To fully remove all Airtime files, you will also have to manually delete"
|
||||
echo " the directories '/srv/airtime'(default storage location of media files)"
|
||||
echo -e " and '/etc/airtime'(where the config files are stored).\n"
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
tableString = "";
|
||||
tableString += "<h3>" + options.text.onAirToday + "</h3>";
|
||||
tableString += "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='widget widget no-playing-list small'>"+
|
||||
tableString += "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='widget widget now-playing-list small'>"+
|
||||
"<tbody>";
|
||||
|
||||
for (var i=0; i<shows.length; i++){
|
||||
|
@ -44,6 +44,7 @@
|
|||
}
|
||||
|
||||
function processData(data){
|
||||
checkWidgetVersion(data);
|
||||
sd = new ScheduleData(data);
|
||||
updateWidget();
|
||||
}
|
||||
|
@ -117,7 +118,7 @@
|
|||
|
||||
obj.empty();
|
||||
obj.append("<h4>"+showStatus+" >></h4>");
|
||||
obj.append("<ul class='widget no-playing-bar'>" +
|
||||
obj.append("<ul class='widget now-playing-bar'>" +
|
||||
"<li class='current'>"+options.text.current+": "+currentShowName+
|
||||
"<span id='time-elapsed' class='time-elapsed'>"+timeElapsed+"</span>" +
|
||||
"<span id='time-remaining' class='time-remaining'>"+timeRemaining+"</span>"+
|
||||
|
@ -127,6 +128,7 @@
|
|||
}
|
||||
|
||||
function processData(data){
|
||||
checkWidgetVersion(data);
|
||||
sd = new ScheduleData(data);
|
||||
}
|
||||
|
||||
|
@ -189,7 +191,7 @@
|
|||
function updateWidget(data){
|
||||
for (var i=0; i<dow.length; i++){
|
||||
var html =
|
||||
'<table class="widget widget no-playing-list">'+
|
||||
'<table class="widget widget now-playing-list">'+
|
||||
'<colgroup>'+
|
||||
'<col width="150" />'+
|
||||
'<col width="350" />'+
|
||||
|
@ -234,6 +236,7 @@
|
|||
}
|
||||
|
||||
function processData(data){
|
||||
checkWidgetVersion(data);
|
||||
updateWidget(data);
|
||||
}
|
||||
|
||||
|
@ -393,3 +396,19 @@ function convertDateToPosixTime(s){
|
|||
|
||||
return Date.UTC(year, month-1, day, hour, minute, sec, msec);
|
||||
}
|
||||
|
||||
/* Checks the incomming data's widget version tag.
|
||||
* The current widget version is 1.
|
||||
* -If the value returned is equal to 1 do nothing.
|
||||
* -If the value doesn't exist or it is great then 1 throw error warning the user they should upgrade their airtime install.
|
||||
* -If the value is less then 1 warn the user that they should upgrade the javascript to a newer version.
|
||||
*/
|
||||
function checkWidgetVersion(data){
|
||||
var widgetVersion = data['widgetVersion'];
|
||||
//console.log(widgetVersion);
|
||||
if (undefined === widgetVersion || widgetVersion > 1)
|
||||
throw 'The widgets you are using are out of date, please get the latest jquery.showinfo.js file.';
|
||||
else if (widgetVersion < 1)
|
||||
throw 'The version of airtime that you are using should be upgraded to work with this widget';
|
||||
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<li><a href="#sunday">Sunday</a></li>
|
||||
</ul>
|
||||
<div id="monday">
|
||||
<table class="widget widget no-playing-list">
|
||||
<table class="widget widget now-playing-list">
|
||||
<colgroup>
|
||||
<col width="150">
|
||||
<col width="350">
|
||||
|
@ -316,7 +316,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="tuesday">
|
||||
<table class="widget widget no-playing-list">
|
||||
<table class="widget widget now-playing-list">
|
||||
<colgroup>
|
||||
<col width="150">
|
||||
<col width="350">
|
||||
|
@ -542,7 +542,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="wednesday">
|
||||
<table class="widget widget no-playing-list">
|
||||
<table class="widget widget now-playing-list">
|
||||
<colgroup>
|
||||
<col width="150">
|
||||
<col width="350">
|
||||
|
@ -810,7 +810,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="thursday">
|
||||
<table class="widget widget no-playing-list">
|
||||
<table class="widget widget now-playing-list">
|
||||
<colgroup>
|
||||
<col width="150">
|
||||
<col width="350">
|
||||
|
@ -1099,7 +1099,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="friday">
|
||||
<table class="widget widget no-playing-list">
|
||||
<table class="widget widget now-playing-list">
|
||||
<colgroup>
|
||||
<col width="150">
|
||||
<col width="350">
|
||||
|
@ -1374,7 +1374,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="saturday">
|
||||
<table class="widget widget no-playing-list">
|
||||
<table class="widget widget now-playing-list">
|
||||
<colgroup>
|
||||
<col width="150">
|
||||
<col width="350">
|
||||
|
@ -1572,7 +1572,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="sunday">
|
||||
<table class="widget widget no-playing-list">
|
||||
<table class="widget widget now-playing-list">
|
||||
<colgroup>
|
||||
<col width="150">
|
||||
<col width="350">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<body>
|
||||
<div id="headerLiveHolder">
|
||||
<h4>On air now >></h4>
|
||||
<ul class="widget no-playing-bar">
|
||||
<ul class="widget now-playing-bar">
|
||||
<li class="current">Current: Réseau jeunesse<span class="time-elapsed" id="time-elapsed">02:22</span><span class="time-remaining" id="time-remaining">27:37</span></li>
|
||||
<li class="next">Next: Mano River Press (EN)<span>07:00 - 07:30</span></li>
|
||||
</ul>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<br />
|
||||
<div id="onAirToday">
|
||||
<h3>On air today</h3>
|
||||
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="widget widget no-playing-list small">
|
||||
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="widget widget now-playing-list small">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="time">04:30 - 05:00</td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue