Merge branch '1.9.1' of dev.sourcefabric.org:airtime into 1.9.1
This commit is contained in:
commit
fa590463fe
|
@ -307,9 +307,8 @@ class Schedule {
|
||||||
$row["id"] = $row["group_id"];
|
$row["id"] = $row["group_id"];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql = "SELECT MIN(st.name) AS name,"
|
$sql = "SELECT MIN(pt.creator) AS creator,"
|
||||||
." MIN(pt.creator) AS creator,"
|
." st.group_id,"
|
||||||
." st.group_id, "
|
|
||||||
." SUM(st.clip_length) AS clip_length,"
|
." SUM(st.clip_length) AS clip_length,"
|
||||||
." MIN(st.file_id) AS file_id,"
|
." MIN(st.file_id) AS file_id,"
|
||||||
." COUNT(*) as count,"
|
." COUNT(*) as count,"
|
||||||
|
|
|
@ -6,7 +6,7 @@ require_once('DB.php');
|
||||||
class AirtimeInstall
|
class AirtimeInstall
|
||||||
{
|
{
|
||||||
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
||||||
const CONF_DIR_WWW = "/usr/share/airtime/";
|
const CONF_DIR_WWW = "/usr/share/airtime";
|
||||||
const CONF_DIR_LOG = "/var/log/airtime";
|
const CONF_DIR_LOG = "/var/log/airtime";
|
||||||
|
|
||||||
public static $databaseTablesCreated = false;
|
public static $databaseTablesCreated = false;
|
||||||
|
|
|
@ -172,6 +172,9 @@ function MergeConfigFiles($configFiles, $suffix)
|
||||||
// Parse with sections
|
// Parse with sections
|
||||||
$newSettings = parse_ini_file($conf, true);
|
$newSettings = parse_ini_file($conf, true);
|
||||||
$oldSettings = parse_ini_file("$conf$suffix.bak", true);
|
$oldSettings = parse_ini_file("$conf$suffix.bak", true);
|
||||||
|
|
||||||
|
$oldSettings['general']['airtime_dir'] = '/var/www/airtime';
|
||||||
|
$oldSettings['general']['base_files_dir'] = '/srv/airtime';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$newSettings = ReadPythonConfig($conf);
|
$newSettings = ReadPythonConfig($conf);
|
||||||
|
@ -238,6 +241,13 @@ function LoadConfig($CC_CONFIG) {
|
||||||
return $CC_CONFIG;
|
return $CC_CONFIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function movePhpFiles($CC_CONFIG){
|
||||||
|
$phpDir = $CC_CONFIG['phpDir'];
|
||||||
|
echo "Copying Server files from $phpDir/airtime_mvc to /var/www/airtime";
|
||||||
|
exec("mkdir -p /var/www/airtime");
|
||||||
|
exec("cp -R $phpDir/airtime_mvc/* /var/www/airtime");
|
||||||
|
}
|
||||||
|
|
||||||
// Backup the config files
|
// Backup the config files
|
||||||
$suffix = date("Ymdhis")."-1.8.0";
|
$suffix = date("Ymdhis")."-1.8.0";
|
||||||
foreach ($configFiles as $conf) {
|
foreach ($configFiles as $conf) {
|
||||||
|
@ -247,9 +257,16 @@ foreach ($configFiles as $conf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$CC_CONFIG = LoadConfig($CC_CONFIG);
|
||||||
|
movePhpFiles($CC_CONFIG);
|
||||||
|
|
||||||
$default_suffix = "180";
|
$default_suffix = "180";
|
||||||
CreateIniFiles($default_suffix);
|
CreateIniFiles($default_suffix);
|
||||||
echo "* Initializing INI files".PHP_EOL;
|
echo "* Initializing INI files".PHP_EOL;
|
||||||
|
|
||||||
|
|
||||||
MergeConfigFiles($configFiles, $suffix);
|
MergeConfigFiles($configFiles, $suffix);
|
||||||
|
|
||||||
$CC_CONFIG = LoadConfig($CC_CONFIG);
|
|
||||||
|
|
||||||
|
|
|
@ -581,16 +581,6 @@ class Airtime190Upgrade{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// we don't need thses functions anymore as it's done in CreateSymlinksToUtils()
|
|
||||||
/*public static function removeOldAirtimeImport(){
|
|
||||||
exec('rm -f "/usr/bin/airtime-import"');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function updateAirtimeImportSymLink(){
|
|
||||||
$dir = "/usr/lib/airtime/utils/airtime-import/airtime-import";
|
|
||||||
exec("ln -s $dir /usr/bin/airtime-import");
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public static function execSqlQuery($sql){
|
public static function execSqlQuery($sql){
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ if output_icecast_mp3 then
|
||||||
|
|
||||||
#format = %mp3(bitrate=192, samplerate=44100, stereo=false)
|
#format = %mp3(bitrate=192, samplerate=44100, stereo=false)
|
||||||
ignore(output.icecast(%mp3,
|
ignore(output.icecast(%mp3,
|
||||||
|
encoding = "UTF-8",
|
||||||
host = icecast_host,
|
host = icecast_host,
|
||||||
port = icecast_port,
|
port = icecast_port,
|
||||||
password = icecast_pass,
|
password = icecast_pass,
|
||||||
|
@ -75,6 +76,7 @@ end
|
||||||
if output_icecast_vorbis then
|
if output_icecast_vorbis then
|
||||||
if output_icecast_vorbis_metadata then
|
if output_icecast_vorbis_metadata then
|
||||||
ignore(output.icecast(%vorbis,
|
ignore(output.icecast(%vorbis,
|
||||||
|
encoding = "UTF-8",
|
||||||
host = icecast_host,
|
host = icecast_host,
|
||||||
port = icecast_port,
|
port = icecast_port,
|
||||||
password = icecast_pass,
|
password = icecast_pass,
|
||||||
|
|
|
@ -162,9 +162,11 @@ class PypoPush(Thread):
|
||||||
|
|
||||||
logger.debug('Preparing to push playlist %s' % pkey)
|
logger.debug('Preparing to push playlist %s' % pkey)
|
||||||
for item in playlist:
|
for item in playlist:
|
||||||
annotate = str(item['annotate'])
|
annotate = item['annotate']
|
||||||
tn.write(('queue.push %s\n' % annotate).encode('latin-1'))
|
tn.write(str('queue.push %s\n' % annotate.encode('utf-8')))
|
||||||
tn.write(('vars.show_name %s\n' % item['show_name']).encode('latin-1'))
|
|
||||||
|
show_name = item['show_name']
|
||||||
|
tn.write(str('vars.show_name %s\n' % show_name.encode('utf-8')))
|
||||||
|
|
||||||
tn.write("exit\n")
|
tn.write("exit\n")
|
||||||
logger.debug(tn.read_all())
|
logger.debug(tn.read_all())
|
||||||
|
|
|
@ -5,10 +5,15 @@ we need to update database host, dbname, username and password.
|
||||||
This script reads from airtime.conf.
|
This script reads from airtime.conf.
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
from xml.dom.minidom import Node
|
from xml.dom.minidom import Node
|
||||||
|
|
||||||
|
if os.geteuid() != 0:
|
||||||
|
print "Please run this as root."
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
#Read the universal values
|
#Read the universal values
|
||||||
parser = ConfigParser.SafeConfigParser()
|
parser = ConfigParser.SafeConfigParser()
|
||||||
parser.read('/etc/airtime/airtime.conf')
|
parser.read('/etc/airtime/airtime.conf')
|
||||||
|
|
Loading…
Reference in New Issue