diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 5b4b37d92..7a27541e4 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -307,9 +307,8 @@ class Schedule { $row["id"] = $row["group_id"]; } } else { - $sql = "SELECT MIN(st.name) AS name," - ." MIN(pt.creator) AS creator," - ." st.group_id, " + $sql = "SELECT MIN(pt.creator) AS creator," + ." st.group_id," ." SUM(st.clip_length) AS clip_length," ." MIN(st.file_id) AS file_id," ." COUNT(*) as count," diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index fd03eab10..bf9a3d55a 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -6,7 +6,7 @@ require_once('DB.php'); class AirtimeInstall { 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"; public static $databaseTablesCreated = false; diff --git a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php index dabbf0b22..25b1ba1b6 100644 --- a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php @@ -172,6 +172,9 @@ function MergeConfigFiles($configFiles, $suffix) // Parse with sections $newSettings = parse_ini_file($conf, true); $oldSettings = parse_ini_file("$conf$suffix.bak", true); + + $oldSettings['general']['airtime_dir'] = '/var/www/airtime'; + $oldSettings['general']['base_files_dir'] = '/srv/airtime'; } else { $newSettings = ReadPythonConfig($conf); @@ -238,6 +241,13 @@ function LoadConfig($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 $suffix = date("Ymdhis")."-1.8.0"; foreach ($configFiles as $conf) { @@ -247,9 +257,16 @@ foreach ($configFiles as $conf) { } } + +$CC_CONFIG = LoadConfig($CC_CONFIG); +movePhpFiles($CC_CONFIG); + $default_suffix = "180"; CreateIniFiles($default_suffix); echo "* Initializing INI files".PHP_EOL; + + MergeConfigFiles($configFiles, $suffix); -$CC_CONFIG = LoadConfig($CC_CONFIG); + + diff --git a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php index 6f1843572..ebcb9358a 100644 --- a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php @@ -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){ global $CC_DBC; diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq index f47179268..03a8dbbea 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq @@ -58,6 +58,7 @@ if output_icecast_mp3 then #format = %mp3(bitrate=192, samplerate=44100, stereo=false) ignore(output.icecast(%mp3, + encoding = "UTF-8", host = icecast_host, port = icecast_port, password = icecast_pass, @@ -75,6 +76,7 @@ end if output_icecast_vorbis then if output_icecast_vorbis_metadata then ignore(output.icecast(%vorbis, + encoding = "UTF-8", host = icecast_host, port = icecast_port, password = icecast_pass, diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index 21d2a42b9..d427499a2 100644 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -162,9 +162,11 @@ class PypoPush(Thread): logger.debug('Preparing to push playlist %s' % pkey) for item in playlist: - annotate = str(item['annotate']) - tn.write(('queue.push %s\n' % annotate).encode('latin-1')) - tn.write(('vars.show_name %s\n' % item['show_name']).encode('latin-1')) + annotate = item['annotate'] + tn.write(str('queue.push %s\n' % annotate.encode('utf-8'))) + + show_name = item['show_name'] + tn.write(str('vars.show_name %s\n' % show_name.encode('utf-8'))) tn.write("exit\n") logger.debug(tn.read_all()) diff --git a/utils/airtime-update-db-settings.py b/utils/airtime-update-db-settings.py index 7fc657b4e..ff292a460 100644 --- a/utils/airtime-update-db-settings.py +++ b/utils/airtime-update-db-settings.py @@ -5,10 +5,15 @@ we need to update database host, dbname, username and password. This script reads from airtime.conf. """ import os +import sys import ConfigParser import xml.dom.minidom from xml.dom.minidom import Node +if os.geteuid() != 0: + print "Please run this as root." + sys.exit(1) + #Read the universal values parser = ConfigParser.SafeConfigParser() parser.read('/etc/airtime/airtime.conf')