-
-
-
diff --git a/application/views/scripts/schedule/cancel-current-show.phtml b/application/views/scripts/schedule/cancel-current-show.phtml
new file mode 100644
index 000000000..837c66731
--- /dev/null
+++ b/application/views/scripts/schedule/cancel-current-show.phtml
@@ -0,0 +1 @@
+
View script for controller Schedule and script/action name cancelCurrentShow
\ No newline at end of file
diff --git a/install/DoctrineMigrations/migrations.xml b/install/DoctrineMigrations/migrations.xml
index bcadb0e1c..bab01e8a6 100644
--- a/install/DoctrineMigrations/migrations.xml
+++ b/install/DoctrineMigrations/migrations.xml
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/migrations/configuration
http://doctrine-project.org/schemas/migrations/configuration.xsd">
-
Doctrine Sandbox Migrations
+
Airtime 1.7 Database Upgrade
DoctrineMigrations
diff --git a/install/airtime-install.php b/install/airtime-install.php
index 2c47b65c3..984928e74 100644
--- a/install/airtime-install.php
+++ b/install/airtime-install.php
@@ -41,6 +41,7 @@ installPostgresScriptingLanguage();
echo "* Creating Database Tables".PHP_EOL;
createAirtimeDatabaseTables();
+doctrineMigrateTables(__DIR__);
echo "* Storage Directory Setup".PHP_EOL;
storageDirectorySetup($CC_CONFIG);
diff --git a/install/airtime-uninstall.php b/install/airtime-uninstall.php
index 4e52f8dcf..5f425610d 100644
--- a/install/airtime-uninstall.php
+++ b/install/airtime-uninstall.php
@@ -22,15 +22,6 @@ checkIfRoot();
echo "******************************* Uninstall Begin ********************************".PHP_EOL;
-
-
-
-function airtime_uninstall_delete_files($p_path)
-{
- $command = "rm -rf $p_path";
- exec($command);
-}
-
//------------------------------------------------------------------------
// Delete the database
// Note: Do not put a call to airtime_db_connect()
@@ -48,142 +39,26 @@ $command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']} 2> /dev/null
if ($dbDeleteFailed) {
echo " * Couldn't delete the database, so deleting all the DB tables...".PHP_EOL;
airtime_db_connect(true);
- if (!PEAR::isError($CC_DBC)) {
- if (airtime_db_table_exists($CC_CONFIG['prefTable'])) {
- echo " * Removing database table ".$CC_CONFIG['prefTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['prefTable'];
- airtime_install_query($sql, false);
- $CC_DBC->dropSequence($CC_CONFIG['prefTable']."_id");
+ if (!PEAR::isError($CC_DBC)) {
+ $sql = "select * from pg_tables where tableowner = 'airtime'";
+ $rows = airtime_get_query($sql);
+
+ foreach ($rows as $row){
+ $tablename = $row["tablename"];
+ echo " * Removing database table $tablename...";
+
+ if (airtime_db_table_exists($tablename)){
+ $sql = "DROP TABLE $tablename CASCADE";
+ airtime_install_query($sql, false);
+
+ $CC_DBC->dropSequence($tablename."_id");
+ }
echo "done.".PHP_EOL;
- } else {
- echo " * Skipping: database table $CC_CONFIG[prefTable]".PHP_EOL;
}
}
-
- if (airtime_db_table_exists($CC_CONFIG['transTable'])) {
- echo " * Removing database table ".$CC_CONFIG['transTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['transTable'];
- airtime_install_query($sql, false);
-
- $CC_DBC->dropSequence($CC_CONFIG['transTable']."_id");
- echo "done.".PHP_EOL;
- } else {
- echo " * Skipping: database table $CC_CONFIG[transTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['filesTable'])) {
- echo " * Removing database table ".$CC_CONFIG['filesTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['filesTable']." CASCADE";
- airtime_install_query($sql);
- $CC_DBC->dropSequence($CC_CONFIG['filesTable']."_id");
-
- } else {
- echo " * Skipping: database table $CC_CONFIG[filesTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['playListTable'])) {
- echo " * Removing database table ".$CC_CONFIG['playListTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['playListTable']." CASCADE";
- airtime_install_query($sql);
- $CC_DBC->dropSequence($CC_CONFIG['playListTable']."_id");
-
- } else {
- echo " * Skipping: database table $CC_CONFIG[playListTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['playListContentsTable'])) {
- echo " * Removing database table ".$CC_CONFIG['playListContentsTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['playListContentsTable'];
- airtime_install_query($sql);
- $CC_DBC->dropSequence($CC_CONFIG['playListContentsTable']."_id");
-
- } else {
- echo " * Skipping: database table $CC_CONFIG[playListContentsTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['accessTable'])) {
- echo " * Removing database table ".$CC_CONFIG['accessTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['accessTable'];
- airtime_install_query($sql);
- } else {
- echo " * Skipping: database table $CC_CONFIG[accessTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['permTable'])) {
- echo " * Removing database table ".$CC_CONFIG['permTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['permTable'];
- airtime_install_query($sql, false);
-
- $CC_DBC->dropSequence($CC_CONFIG['permTable']."_id");
- echo "done.".PHP_EOL;
- } else {
- echo " * Skipping: database table $CC_CONFIG[permTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['sessTable'])) {
- echo " * Removing database table ".$CC_CONFIG['sessTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['sessTable'];
- airtime_install_query($sql);
- } else {
- echo " * Skipping: database table $CC_CONFIG[sessTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['subjTable'])) {
- echo " * Removing database table ".$CC_CONFIG['subjTable']."...";
- $CC_DBC->dropSequence($CC_CONFIG['subjTable']."_id");
-
- $sql = "DROP TABLE ".$CC_CONFIG['subjTable']." CASCADE";
- airtime_install_query($sql, false);
-
- echo "done.".PHP_EOL;
- } else {
- echo " * Skipping: database table $CC_CONFIG[subjTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['smembTable'])) {
- echo " * Removing database table ".$CC_CONFIG['smembTable']."...";
- $sql = "DROP TABLE ".$CC_CONFIG['smembTable'];
- airtime_install_query($sql, false);
-
- $CC_DBC->dropSequence($CC_CONFIG['smembTable']."_id");
- echo "done.".PHP_EOL;
- } else {
- echo " * Skipping: database table $CC_CONFIG[smembTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['scheduleTable'])) {
- echo " * Removing database table ".$CC_CONFIG['scheduleTable']."...";
- airtime_install_query("DROP TABLE ".$CC_CONFIG['scheduleTable']);
- } else {
- echo " * Skipping: database table $CC_CONFIG[scheduleTable]".PHP_EOL;
- }
-
- if (airtime_db_table_exists($CC_CONFIG['backupTable'])) {
- echo " * Removing database table ".$CC_CONFIG['backupTable']."...";
- airtime_install_query("DROP TABLE ".$CC_CONFIG['backupTable']);
- } else {
- echo " * Skipping: database table $CC_CONFIG[backupTable]".PHP_EOL;
- }
}
-//Delete Database
-//system("dropdb -h localhost -U airtime -W airtime");
-//select * from pg_stat_activity where datname='airtime';
-/*
-$rows = airtime_get_query("select procpid from pg_stat_activity where datname='airtime'");
-$rowsCount = count($rows);
-for ($i=0; $i<$rowsCount; $i++){
- $command = "kill -2 {$rows[$i]['procpid']}";
- echo $command.PHP_EOL;
- system($command);
-}
-echo "still here!";
-system("dropdb -h localhost -U airtime -W airtime");
-exit;
-*/
-
-
//------------------------------------------------------------------------
// Delete the user
//------------------------------------------------------------------------
diff --git a/install/installInit.php b/install/installInit.php
index db511c11f..251907cd9 100644
--- a/install/installInit.php
+++ b/install/installInit.php
@@ -188,3 +188,9 @@ function doctrineMigrateTables($dir){
$command = "php $dir/../library/doctrine/migrations/doctrine-migrations.phar --configuration=$dir/DoctrineMigrations/migrations.xml --db-configuration=$dir/../library/doctrine/migrations/migrations-db.php --no-interaction migrations:migrate";
system($command);
}
+
+function airtime_uninstall_delete_files($p_path)
+{
+ $command = "rm -rf $p_path";
+ exec($command);
+}
diff --git a/public/css/images/icon_overlap.png b/public/css/images/icon_overlap.png
new file mode 100644
index 000000000..27563a6b1
Binary files /dev/null and b/public/css/images/icon_overlap.png differ
diff --git a/public/css/images/record_icon.png b/public/css/images/record_icon.png
new file mode 100644
index 000000000..5e468705b
Binary files /dev/null and b/public/css/images/record_icon.png differ
diff --git a/public/css/styles.css b/public/css/styles.css
index 26c2f8e6a..c736e2ebf 100644
--- a/public/css/styles.css
+++ b/public/css/styles.css
@@ -142,6 +142,9 @@ select {
color:#969696;
padding-right:12px;
}
+.text-row.rebroadcast, #master-panel .text-row.rebroadcast {
+ color:#969696;
+}
.now-playing-info {
height:25px;
background:#3a3a3a url(images/playinfo_bg.png) repeat-x 0 0;
@@ -157,10 +160,6 @@ select {
overflow:hidden;
margin-bottom:3px;
}
-.now-playing-info .time-flow {
- float:right;
- margin-right:6px;
-}
.time-elapsed {
color:#9b9b9b;
padding-right:6px;
@@ -443,7 +442,7 @@ dl.inline-list dd {
.datatable tr.odd.selected td {
background-color: #c5deeb;
}
-.datatable tr:hover td {
+.datatable tr.odd:hover td, .datatable tr.even:hover td {
background-color: #95d5f7 !important;
}
@@ -1198,10 +1197,12 @@ button, input {
height:25px;
margin-right:6px
}
-.button-bar-top .input_text.hasDatepicker {
+.button-bar-top .input_text.hasDatepicker, .input_text.hasDatepicker {
background:url(images/input_with_calendar_bg.png) no-repeat right 0;
}
-
+.input_text.hasTimepicker {
+ background:url(images/input_with_time_bg.png) no-repeat right 0;
+}
ul.errors {
display:block;
clear:left;
@@ -1298,8 +1299,8 @@ ul.errors li {
}
/*---//////////////////// NOW PLAYING COLORS ////////////////////---*/
-.playing-song {
- background-color:#ff753c;
+.playing-song, .datatable tr.playing-song:hover td {
+ background-color:#ff753c !important;
}
.playing-list {
background-color:#b0dcf2;
@@ -1307,9 +1308,15 @@ ul.errors li {
.odd.playing-list {
background-color:#bfe5f8;
}
-.gap {
- background-color:#da5454;
+.gap, .datatable tr.gap:hover td {
+ background-color:#da5454 !important;
}
+.group, tr td.group {
+ background-color:#0aa2be;
+ color:#FFF;
+}
+
+
/*---//////////////////// END NOW PLAYING COLORS ////////////////////---*/
.icon-link, .ui-widget-content a.icon-link {
color: #646464;
@@ -1412,4 +1419,62 @@ ul.errors li {
}
.gray-logo {
margin:5px 0 0 20px;
-}
\ No newline at end of file
+}
+.formrow-repeat {
+ list-style-type:none;
+ margin:0;
+ padding:0;
+}
+.formrow-repeat li {
+ list-style-type:none;
+ margin:0 0 7px 0;
+ padding:0;
+ height:26px;
+ display:block;
+}
+.formrow-repeat li .ui-button-icon-only {
+ width:1.8em;
+}
+.formrow-repeat li .ui-button-icon-only .ui-button-text, .formrow-repeat li .ui-button-icons-only .ui-button-text {
+ padding: 3px 3px 4px;
+}
+
+.formrow-repeat li .ui-button-icon-only .ui-icon {
+ left: 48%;
+ margin-top: -9px;
+ position: absolute;
+ top: 50%;
+}
+.formrow-repeat li .ui-button .ui-button-text {
+ display: block;
+ line-height: 110%;
+}
+.formrow-repeat li .inline-text {
+ color: #666666;
+ padding: 0 6px 0 0;
+}
+.formrow-repeat li .input_text, .formrow-repeat li .input_select {
+ margin-right:6px;
+}
+.formrow-repeat li .hasDatepicker, .formrow-repeat li .input_select {
+ width:160px;
+}
+.formrow-repeat li .hasTimepicker {
+ width:80px;
+}
+.recording-show {
+ float: right;
+ background:url(images/record_icon.png) no-repeat 0 0;
+ width:23px;
+ height:23px;
+}
+
+.datatable td .info-icon {
+ margin:-4px 3px -3px 0;
+ float:right;
+}
+
+.time-flow {
+ float:right;
+ margin-right:4px;
+}
diff --git a/public/js/airtime/schedule/schedule.js b/public/js/airtime/schedule/schedule.js
index 48b256a10..79c364e4c 100644
--- a/public/js/airtime/schedule/schedule.js
+++ b/public/js/airtime/schedule/schedule.js
@@ -155,6 +155,16 @@ function makeScheduleDialog(dialog, json) {
setScheduleDialogEvents(dialog);
}
+function confirmCancelShow(show_instance_id){
+ if(confirm('Erase current show and stop playback?')){
+ var url = "/Schedule/cancel-current-show/id/"+show_instance_id;
+ $.ajax({
+ url: url,
+ success: function(data){scheduleRefetchEvents();}
+ });
+ }
+}
+
function buildContentDialog(json){
var dialog = $(json.dialog);
diff --git a/public/js/playlist/nowplayingdatagrid.js b/public/js/playlist/nowplayingdatagrid.js
index 9d4151e2f..33e077a19 100644
--- a/public/js/playlist/nowplayingdatagrid.js
+++ b/public/js/playlist/nowplayingdatagrid.js
@@ -50,6 +50,14 @@ function notifyShowStart(show){
updateDataTable();
}
+function statusColumn(obj) {
+ var sReturn = obj.aData[ obj.iDataColumn ];
+ if ( sReturn == "x" ) {
+ sReturn = '

';
+ }
+ return sReturn;
+}
+
var columns = [{"sTitle": "type", "bVisible":false},
{"sTitle":"Date"},
{"sTitle":"Start"},
@@ -60,6 +68,7 @@ var columns = [{"sTitle": "type", "bVisible":false},
{"sTitle":"Album"},
{"sTitle":"Playlist"},
{"sTitle":"Show"},
+ {"sTitle":"Status", "fnRender":statusColumn},
{"sTitle":"instance_id", "bVisible":false}];
function getDateString(){
diff --git a/public/js/playlist/playlist.js b/public/js/playlist/playlist.js
index 434a19fdb..82f277d1c 100644
--- a/public/js/playlist/playlist.js
+++ b/public/js/playlist/playlist.js
@@ -165,9 +165,13 @@ function updatePlaybar(){
/* Column 1 update */
$('#playlist').text("Current Show:");
- if (currentShow.length > 0)
+ if (currentShow.length > 0){
$('#playlist').text(currentShow[0].name);
+ var recElem = $('.recording-show');
+ currentShow[0].record ? recElem.show(): recElem.hide();
+ }
+
$('#show-length').empty();
if (currentShow.length > 0){
$('#show-length').text(convertDateToHHMM(currentShow[0].showStartPosixTime) + " - " + convertDateToHHMM(currentShow[0].showEndPosixTime));
diff --git a/pypo/api_clients/api_client.py b/pypo/api_clients/api_client.py
index 5fd04b522..6994cf3fd 100644
--- a/pypo/api_clients/api_client.py
+++ b/pypo/api_clients/api_client.py
@@ -115,7 +115,6 @@ class AirTimeApiClient(ApiClientInterface):
url = url.replace("%%api_key%%", self.config["api_key"])
try:
- logger.debug("Trying to contact %s", url)
response = urllib.urlopen(url)
data = response.read()
logger.debug("Data: %s", data)
@@ -278,7 +277,7 @@ class AirTimeApiClient(ApiClientInterface):
logger.info("API-Message %s", response['message'])
except Exception, e:
- logger.critical("Unable to connect - %s", e)
+ logger.error("Unable to connect - %s", e)
return response
@@ -304,7 +303,7 @@ class AirTimeApiClient(ApiClientInterface):
logger.info("API-Message %s", response['message'])
except Exception, e:
- logger.critical("Exception: %s", e)
+ logger.error("Exception: %s", e)
return response
@@ -475,7 +474,7 @@ class ObpApiClient():
except Exception, e:
print e
api_status = False
- logger.critical("Unable to connect to the OBP API - %s", e)
+ logger.error("Unable to connect to the OBP API - %s", e)
return response
@@ -510,7 +509,7 @@ class ObpApiClient():
except Exception, e:
print e
api_status = False
- logger.critical("Unable to connect to the OBP API - %s", e)
+ logger.error("Unable to connect to the OBP API - %s", e)
return response
@@ -530,7 +529,7 @@ class ObpApiClient():
except Exception, e:
print e
api_status = False
- logger.critical("Unable to handle the OBP API request - %s", e)
+ logger.error("Unable to handle the OBP API request - %s", e)
return response
diff --git a/pypo/config.cfg b/pypo/config.cfg
index cbe7f38d7..638558fbf 100644
--- a/pypo/config.cfg
+++ b/pypo/config.cfg
@@ -42,7 +42,7 @@ cache_for = 24 #how long to hold the cache, in hours
# the time you expect to "lock-in" your schedule. So if your schedule is set
# 24 hours in advance, this can be set to poll every 12 hours.
#
-poll_interval = 30 # in seconds.
+poll_interval = 5 # in seconds.
# Push interval in seconds.
@@ -52,7 +52,7 @@ poll_interval = 30 # in seconds.
#
# It's hard to imagine a situation where this should be more than 1 second.
#
-push_interval = 1 # in seconds
+push_interval = 2 # in seconds
# 'pre' or 'otf'. 'pre' cues while playlist preparation
# while 'otf' (on the fly) cues while loading into ls
diff --git a/pypo/install/pypo-uninstall.py b/pypo/install/pypo-uninstall.py
index 3d698faac..0b225cc7e 100644
--- a/pypo/install/pypo-uninstall.py
+++ b/pypo/install/pypo-uninstall.py
@@ -15,7 +15,7 @@ def remove_path(path):
os.system("rm -rf " + path)
def remove_user(username):
- os.system("killall -u " + username)
+ os.system("killall -u %s 2>&1 1>/dev/null" % username)
#allow all process to be completely closed before we attempt to delete user
print "Waiting for processes to close..."
diff --git a/pypo/pypo-cli.py b/pypo/pypo-cli.py
index 7a27b13be..3c0402908 100755
--- a/pypo/pypo-cli.py
+++ b/pypo/pypo-cli.py
@@ -67,8 +67,7 @@ logging.config.fileConfig("logging.cfg")
try:
config = ConfigObj('config.cfg')
POLL_INTERVAL = float(config['poll_interval'])
- PUSH_INTERVAL = 0.5
- #PUSH_INTERVAL = float(config['push_interval'])
+ PUSH_INTERVAL = float(config['push_interval'])
LS_HOST = config['ls_host']
LS_PORT = config['ls_port']
except Exception, e:
diff --git a/pypo/pypofetch.py b/pypo/pypofetch.py
index d1665ae3e..aaeda54f5 100644
--- a/pypo/pypofetch.py
+++ b/pypo/pypofetch.py
@@ -91,14 +91,15 @@ class PypoFetch:
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
- #encode in latin-1 due to this bug: http://bugs.python.org/issue1772794
+ #encode in latin-1 due to telnet protocol not supporting utf-8
tn.write(('vars.stream_metadata_type %s\n' % stream_metadata['format']).encode('latin-1'))
tn.write(('vars.station_name %s\n' % stream_metadata['station_name']).encode('latin-1'))
+
tn.write('exit\n')
logger.debug(tn.read_all())
except Exception, e:
- logger.critical("Exception %s", e)
+ logger.error("Exception %s", e)
status = 0
return status
diff --git a/pypo/pypopush.py b/pypo/pypopush.py
index 6da24da72..266443b8f 100644
--- a/pypo/pypopush.py
+++ b/pypo/pypopush.py
@@ -36,8 +36,8 @@ class PypoPush:
gives the number of seconds of the window of opportunity for the scheduler
to catch when a playlist is to be played.
"""
- self.push_ahead = 15
- self.push_ahead2 = 10
+ self.push_ahead = 10
+ self.push_ahead2 = self.push_ahead -5
def set_export_source(self, export_source):
self.export_source = export_source
@@ -59,23 +59,30 @@ class PypoPush:
tcoming = time.localtime(time.time() + self.push_ahead)
tcoming2 = time.localtime(time.time() + self.push_ahead2)
- tnow = time.localtime(time.time())
+
str_tcoming_s = "%04d-%02d-%02d-%02d-%02d-%02d" % (tcoming[0], tcoming[1], tcoming[2], tcoming[3], tcoming[4], tcoming[5])
str_tcoming2_s = "%04d-%02d-%02d-%02d-%02d-%02d" % (tcoming2[0], tcoming2[1], tcoming2[2], tcoming2[3], tcoming2[4], tcoming2[5])
+ currently_on_air = False
if self.schedule == None:
logger.warn('Unable to loop schedule - maybe write in progress?')
logger.warn('Will try again in next loop.')
else:
for pkey in self.schedule:
+ plstart = pkey[0:19]
+ start = self.schedule[pkey]['start']
+ end = self.schedule[pkey]['end']
+
playedFlag = (pkey in playedItems) and playedItems[pkey].get("played", 0)
- if pkey[0:19] == str_tcoming_s or (pkey[0:19] < str_tcoming_s and pkey[0:19] > str_tcoming2_s and not playedFlag):
+
+ if plstart == str_tcoming_s or (plstart < str_tcoming_s and plstart > str_tcoming2_s and not playedFlag):
logger.debug('Preparing to push playlist scheduled at: %s', pkey)
playlist = self.schedule[pkey]
ptype = playlist['subtype']
+ currently_on_air = True
# We have a match, replace the current playlist and
# force liquidsoap to refresh.
@@ -95,6 +102,23 @@ class PypoPush:
logger.debug("Doing callback to server to update 'played' status.")
self.api_client.notify_scheduled_item_start_playing(pkey, self.schedule)
+ if self.schedule != None:
+ tnow = time.localtime(time.time())
+ str_tnow_s = "%04d-%02d-%02d-%02d-%02d-%02d" % (tnow[0], tnow[1], tnow[2], tnow[3], tnow[4], tnow[5])
+ for pkey in self.schedule:
+ start = self.schedule[pkey]['start']
+ end = self.schedule[pkey]['end']
+
+ if start <= str_tnow_s and str_tnow_s < end:
+ currently_on_air = True
+
+ if not currently_on_air:
+ tn = telnetlib.Telnet(LS_HOST, LS_PORT)
+ tn.write('source.skip\n'.encode('latin-1'))
+ tn.write('exit\n')
+ tn.read_all()
+ #logger.info('source.skip')
+ #logger.debug(tn.read_all())
def push_liquidsoap(self, pkey, schedule, ptype):
logger = logging.getLogger()
diff --git a/pypo/scripts/ls_lib.liq b/pypo/scripts/ls_lib.liq
index f9cfd58ce..27ed94f06 100644
--- a/pypo/scripts/ls_lib.liq
+++ b/pypo/scripts/ls_lib.liq
@@ -42,8 +42,19 @@ end
def add_skip_command(s)
# A command to skip
def skip(_)
- source.skip(s)
- "Done!"
+ # get playing (active) queue and flush it
+ l = list.hd(server.execute("queue.secondary_queue"))
+ l = string.split(separator=" ",l)
+ list.iter(fun (rid) -> ignore(server.execute("queue.ignore #{rid}")), l)
+
+ l = list.hd(server.execute("queue.primary_queue"))
+ l = string.split(separator=" ", l)
+ if list.length(l) > 0 then
+ source.skip(s)
+ "Skipped"
+ else
+ "Not skipped"
+ end
end
# Register the command:
server.register(namespace="source",
diff --git a/pypo/scripts/ls_script.liq b/pypo/scripts/ls_script.liq
index 571a00b25..a35495839 100644
--- a/pypo/scripts/ls_script.liq
+++ b/pypo/scripts/ls_script.liq
@@ -4,8 +4,9 @@
set("log.file.path", log_file)
set("log.stdout", true)
set("server.telnet", true)
+set("server.telnet.port", 1234)
-queue = request.queue(id="queue", conservative=true)
+queue = request.queue(id="queue", length=0.5)
queue = audio_to_stereo(queue)
pypo_data = ref '0'
@@ -31,22 +32,22 @@ s = fallback(track_sensitive=false, [queue, default])
s = on_metadata(notify, s)
s = crossfade(s)
# Attach a skip command to the source s:
-add_skip_command(s)
-web_stream_source = input.http(id="web_stream", autostart = false, buffer=0.5, max=20., "")
+#web_stream_source = input.http(id="web_stream", autostart = false, buffer=0.5, max=20., "")
#once the stream is started, give it a sink so that liquidsoap doesn't
#create buffer overflow warnings in the log file.
-output.dummy(fallible=true, web_stream_source)
+#output.dummy(fallible=true, web_stream_source)
-s = switch(track_sensitive = false,
- transitions=[to_live,to_live],
- [
- ({ !web_stream_enabled }, web_stream_source),
- ({ true }, s)
- ]
-)
+#s = switch(track_sensitive = false,
+# transitions=[to_live,to_live],
+# [
+# ({ !web_stream_enabled }, web_stream_source),
+# ({ true }, s)
+# ]
+#)
+add_skip_command(s)
s = map_metadata(append_title, s)