Merge branch '2.1.x' into devel
This commit is contained in:
commit
f029124447
7
CREDITS
7
CREDITS
|
@ -1,3 +1,10 @@
|
|||
=======
|
||||
CREDITS
|
||||
=======
|
||||
Version 2.1.2
|
||||
-------------
|
||||
Same as previous version.
|
||||
|
||||
=======
|
||||
CREDITS
|
||||
=======
|
||||
|
|
|
@ -20,12 +20,30 @@ class Application_Model_LiveLog
|
|||
if ($rows != null) {
|
||||
$last_row = self::UpdateLastLogEndTime(array_pop($rows));
|
||||
array_push($rows, $last_row);
|
||||
$skip = false;
|
||||
} else {
|
||||
$sql = "SELECT * FROM CC_LIVE_LOG"
|
||||
." WHERE state = 'L'"
|
||||
." ORDER BY id";
|
||||
$rows = $con->query($sql)->fetchAll();
|
||||
|
||||
if ($rows != null) {
|
||||
$last_row = self::UpdateLastLogEndTime(array_pop($rows));
|
||||
array_push($rows, $last_row);
|
||||
foreach ($rows as $row) {
|
||||
$sql_delete = "DELETE FROM CC_LIVE_LOG"
|
||||
." WHERE id = '{$row['id']}'";
|
||||
$con->exec($sql_delete);
|
||||
}
|
||||
}
|
||||
$skip = true;
|
||||
}
|
||||
|
||||
$hours = 0;
|
||||
$minutes = 0;
|
||||
$seconds = 0;
|
||||
|
||||
if (!$skip) {
|
||||
foreach ($rows as $row) {
|
||||
$end = new DateTime($row['end_time']);
|
||||
$start = new DateTime($row['start_time']);
|
||||
|
@ -73,6 +91,7 @@ class Application_Model_LiveLog
|
|||
else {
|
||||
$minutes = (double)(($hours*60)+$minutes);
|
||||
}
|
||||
}
|
||||
return $minutes;
|
||||
} catch (Exception $e) {
|
||||
header('HTTP/1.0 503 Service Unavailable');
|
||||
|
@ -99,12 +118,31 @@ class Application_Model_LiveLog
|
|||
if ($rows != null) {
|
||||
$last_row = self::UpdateLastLogEndTime(array_pop($rows));
|
||||
array_push($rows, $last_row);
|
||||
$skip = false;
|
||||
}
|
||||
else {
|
||||
$sql = "SELECT * FROM CC_LIVE_LOG"
|
||||
." WHERE state = 'S'"
|
||||
." ORDER BY id";
|
||||
$rows = $con->query($sql)->fetchAll();
|
||||
|
||||
if ($rows != null) {
|
||||
$last_row = self::UpdateLastLogEndTime(array_pop($rows));
|
||||
array_push($rows, $last_row);
|
||||
foreach ($rows as $row) {
|
||||
$sql_delete = "DELETE FROM CC_LIVE_LOG"
|
||||
." WHERE id = '{$row['id']}'";
|
||||
$con->exec($sql_delete);
|
||||
}
|
||||
}
|
||||
$skip = true;
|
||||
}
|
||||
|
||||
$hours = 0;
|
||||
$minutes = 0;
|
||||
$seconds = 0;
|
||||
|
||||
if (!$skip) {
|
||||
/* Get all shows and tracks from cc_schedule that played
|
||||
* during a scheduled state
|
||||
*/
|
||||
|
@ -215,6 +253,7 @@ class Application_Model_LiveLog
|
|||
else {
|
||||
$minutes = (double)(($hours*60)+$minutes);
|
||||
}
|
||||
}
|
||||
return $minutes;
|
||||
} catch (Exception $e) {
|
||||
header('HTTP/1.0 503 Service Unavailable');
|
||||
|
|
|
@ -889,7 +889,7 @@ Logging::log("getting media! - 2");
|
|||
$command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' 2>&1", $audio_file);
|
||||
|
||||
exec($command, $output, $rv);
|
||||
if ($rv != 0 || count($output) != 0) {
|
||||
if ($rv != 0 || $output[0] == 'TagLib: MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream.') {
|
||||
$result = array("code" => 110, "message" => "This file appears to be corrupted and will not be added to media library.");
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2.1.2 - June 18th, 2012
|
||||
* Bug Fixes
|
||||
* Fixed problem where playout engine may not retrieve program schedule after extended periods of user inactivity.
|
||||
|
||||
2.1.1 - June 12th, 2012
|
||||
* Changes
|
||||
* Add Media page will now display error message and reject uploaded file if it is corrupt
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
|
||||
define('AIRTIME_VERSION', '2.1.1');
|
||||
define('AIRTIME_VERSION', '2.1.2');
|
||||
|
|
|
@ -108,5 +108,9 @@ if (strcmp($version, "2.1.1") < 0){
|
|||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.1/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
if (strcmp($version, "2.1.2") < 0){
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.2/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
|
||||
echo "******************************* Upgrade Complete *******************************".PHP_EOL;
|
||||
|
|
|
@ -7,11 +7,11 @@ class AirtimeDatabaseUpgrade{
|
|||
|
||||
public static function start($p_dbValues){
|
||||
echo "* Updating Database".PHP_EOL;
|
||||
self::task0($p_dbValues);
|
||||
self::runUpgradeScript($p_dbValues);
|
||||
echo " * Complete".PHP_EOL;
|
||||
}
|
||||
|
||||
private static function task0($p_dbValues){
|
||||
private static function runUpgradeScript($p_dbValues){
|
||||
|
||||
$username = $p_dbValues['database']['dbuser'];
|
||||
$password = $p_dbValues['database']['dbpass'];
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/* All functions other than start() should be marked as
|
||||
* private.
|
||||
*/
|
||||
class AirtimeDatabaseUpgrade{
|
||||
|
||||
public static function start($p_dbValues){
|
||||
echo "* Updating Database".PHP_EOL;
|
||||
self::task0($p_dbValues);
|
||||
echo " * Complete".PHP_EOL;
|
||||
}
|
||||
|
||||
private static function task0($p_dbValues){
|
||||
|
||||
$username = $p_dbValues['database']['dbuser'];
|
||||
$password = $p_dbValues['database']['dbpass'];
|
||||
$host = $p_dbValues['database']['host'];
|
||||
$database = $p_dbValues['database']['dbname'];
|
||||
$dir = __DIR__;
|
||||
|
||||
passthru("export PGPASSWORD=$password && psql -h $host -U $username -q -f $dir/data/upgrade.sql $database 2>&1 | grep -v \"will create implicit index\"");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
require_once 'DbUpgrade.php';
|
||||
|
||||
$filename = "/etc/airtime/airtime.conf";
|
||||
$values = parse_ini_file($filename, true);
|
||||
|
||||
AirtimeDatabaseUpgrade::start($values);
|
|
@ -0,0 +1,2 @@
|
|||
DELETE FROM cc_pref WHERE keystr = 'system_version';
|
||||
INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '2.1.2');
|
|
@ -20,7 +20,7 @@ from configobj import ConfigObj
|
|||
import string
|
||||
import hashlib
|
||||
|
||||
AIRTIME_VERSION = "2.1.1"
|
||||
AIRTIME_VERSION = "2.1.2"
|
||||
|
||||
def api_client_factory(config, logger=None):
|
||||
if logger != None:
|
||||
|
|
Loading…
Reference in New Issue