From 58ad52f93fb8bc1eed04815c4a44c38386b49b01 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 12 Sep 2013 16:14:55 +0100 Subject: [PATCH 01/10] CC-5328 Fix virtualenv version check for newer distros --- python_apps/python-virtualenv/virtualenv-install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python_apps/python-virtualenv/virtualenv-install.sh b/python_apps/python-virtualenv/virtualenv-install.sh index 30991faab..8d2764786 100755 --- a/python_apps/python-virtualenv/virtualenv-install.sh +++ b/python_apps/python-virtualenv/virtualenv-install.sh @@ -14,12 +14,11 @@ 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) +NEWEST_VERSION=$(echo -e "$BAD_VERSION\n$VERSION\n" | sort -t '.' -V | 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." + echo "You have version $BAD_VERSION or older installed. Please upgrade python-virtualenv and install Airtime again." exit 1 else echo "Success!" From 8dc100126a4caa05d3bfb71b0e8e2bd95e7ee36c Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 25 Sep 2013 17:36:50 +0100 Subject: [PATCH 02/10] Alert icon for missing file in Now Playing should be orange, to match Media Builder --- airtime_mvc/public/css/redmond/jquery-ui-1.8.8.custom.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/airtime_mvc/public/css/redmond/jquery-ui-1.8.8.custom.css b/airtime_mvc/public/css/redmond/jquery-ui-1.8.8.custom.css index 3ac07ab95..a5dc00619 100644 --- a/airtime_mvc/public/css/redmond/jquery-ui-1.8.8.custom.css +++ b/airtime_mvc/public/css/redmond/jquery-ui-1.8.8.custom.css @@ -214,6 +214,9 @@ .ui-widget-content .ui-icon { background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-widget-content .ui-icon-alert { + background-image: url(images/ui-icons_ff5d1a_256x240.png); +} .ui-widget-header .ui-icon { background-image: url(images/ui-icons_ffffff_256x240.png); } From 28a032388bfe8205e3273ee8fad71a7094e64eaf Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 26 Sep 2013 15:18:41 -0400 Subject: [PATCH 03/10] Start of bugfixing for SAAS-349. * Also identity verification for erry on Freenode. --- airtime_mvc/application/forms/EditUser.php | 4 +++- .../application/validate/NotDemoValidate.php | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 airtime_mvc/application/validate/NotDemoValidate.php diff --git a/airtime_mvc/application/forms/EditUser.php b/airtime_mvc/application/forms/EditUser.php index cff9dfdda..853e8c479 100644 --- a/airtime_mvc/application/forms/EditUser.php +++ b/airtime_mvc/application/forms/EditUser.php @@ -16,7 +16,8 @@ class Application_Form_EditUser extends Zend_Form $userData = Application_Model_User::GetUserData($currentUserId); $notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator(); $emailValidator = Application_Form_Helper_ValidationTypes::overrideEmailAddressValidator(); - + $notDemoValidator = new Application_Validate_NotDemoValidate(); + $this->setDecorators(array( array('ViewScript', array('viewScript' => 'form/edit-user.phtml', "currentUser" => $currentUser->getLogin())))); $this->setAttrib('id', 'current-user-form'); @@ -52,6 +53,7 @@ class Application_Form_EditUser extends Zend_Form $passwordVerify->setRequired(true); $passwordVerify->addFilter('StringTrim'); $passwordVerify->addValidator($notEmptyValidator); + $passwordVerify->addValidator($notDemoValidator); $passwordVerify->setDecorators(array('viewHelper')); $this->addElement($passwordVerify); diff --git a/airtime_mvc/application/validate/NotDemoValidate.php b/airtime_mvc/application/validate/NotDemoValidate.php new file mode 100644 index 000000000..2d9cc0953 --- /dev/null +++ b/airtime_mvc/application/validate/NotDemoValidate.php @@ -0,0 +1,24 @@ + "Cannot be changed in demo mode" + ); + + public function isValid($value) + { + $this->_setValue($value); + + $CC_CONFIG = Config::getConfig(); + if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { + $this->_error(self::NOTDEMO); + return false; + } else { + return false; + } + } +} + From c8bb12ca45047020999855ffc84065a847bdd411 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 26 Sep 2013 15:23:02 -0400 Subject: [PATCH 04/10] Freenode identity verification for #airtime --- freenode.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 freenode.txt diff --git a/freenode.txt b/freenode.txt new file mode 100644 index 000000000..05924a820 --- /dev/null +++ b/freenode.txt @@ -0,0 +1 @@ +e7Y4a8H6 From 11ae76beb87dfd8bda4fcdedfff76e8ec8190a0d Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 26 Sep 2013 16:23:22 -0400 Subject: [PATCH 05/10] Fix SAAS-349 by preventing password changes in demo mode. * Added a NotDemoValidate validator class to ensure no changes to a field in demo mode. * Prevent the user from changing the password of any user in demo mode. * Fixes SAAS-349. --- airtime_mvc/application/forms/AddUser.php | 5 ++++- airtime_mvc/application/forms/EditUser.php | 1 + airtime_mvc/application/validate/NotDemoValidate.php | 6 +++--- freenode.txt | 1 - 4 files changed, 8 insertions(+), 5 deletions(-) delete mode 100644 freenode.txt diff --git a/airtime_mvc/application/forms/AddUser.php b/airtime_mvc/application/forms/AddUser.php index 75a8f659c..1d3835ae7 100644 --- a/airtime_mvc/application/forms/AddUser.php +++ b/airtime_mvc/application/forms/AddUser.php @@ -1,4 +1,5 @@ setAttrib('id', 'user_form'); $hidden = new Zend_Form_Element_Hidden('user_id'); @@ -42,6 +44,7 @@ class Application_Form_AddUser extends Zend_Form $passwordVerify->setRequired(true); $passwordVerify->addFilter('StringTrim'); $passwordVerify->addValidator($notEmptyValidator); + $passwordVerify->addValidator($notDemoValidator); $this->addElement($passwordVerify); $firstName = new Zend_Form_Element_Text('first_name'); diff --git a/airtime_mvc/application/forms/EditUser.php b/airtime_mvc/application/forms/EditUser.php index 853e8c479..2711bb334 100644 --- a/airtime_mvc/application/forms/EditUser.php +++ b/airtime_mvc/application/forms/EditUser.php @@ -1,4 +1,5 @@ _setValue($value); - + $this->_setValue($value); + $CC_CONFIG = Config::getConfig(); if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { $this->_error(self::NOTDEMO); return false; } else { - return false; + return true; } } } diff --git a/freenode.txt b/freenode.txt deleted file mode 100644 index 05924a820..000000000 --- a/freenode.txt +++ /dev/null @@ -1 +0,0 @@ -e7Y4a8H6 From 9f38e5a9c61dbb45a61fc1e131ce0990fe0fc6aa Mon Sep 17 00:00:00 2001 From: Naomi Date: Thu, 26 Sep 2013 17:03:18 -0400 Subject: [PATCH 06/10] CC-5342 : Pypo: Webstream disconnection happens when any changes on Now playing page --- python_apps/pypo/pypoliquidsoap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/pypo/pypoliquidsoap.py b/python_apps/pypo/pypoliquidsoap.py index 50a47db94..96c0eca0f 100644 --- a/python_apps/pypo/pypoliquidsoap.py +++ b/python_apps/pypo/pypoliquidsoap.py @@ -181,7 +181,7 @@ class PypoLiquidsoap(): #handle webstreams current_stream_id = self.telnet_liquidsoap.get_current_stream_id() if scheduled_now_webstream: - if current_stream_id != scheduled_now_webstream[0]: + if int(current_stream_id) != int(scheduled_now_webstream[0]["row_id"]): self.play(scheduled_now_webstream[0]) elif current_stream_id != "-1": #something is playing and it shouldn't be. From 7d739a0f66d1a4b382a8a59a0a0396943b3df749 Mon Sep 17 00:00:00 2001 From: Naomi Date: Mon, 30 Sep 2013 13:56:27 -0400 Subject: [PATCH 07/10] CC-5316 : Playout History: Doesn't support webstream adding the webstream metadata to the history table. --- .../application/controllers/ApiController.php | 29 ++++++---- .../application/forms/EditHistoryItem.php | 2 +- .../airtime/CcPlayoutHistoryMetaData.php | 16 ++++++ .../airtime/map/CcPlayoutHistoryTableMap.php | 2 +- .../application/services/HistoryService.php | 53 +++++++++++++++++-- airtime_mvc/build/schema.xml | 2 +- airtime_mvc/build/sql/schema.sql | 2 +- 7 files changed, 87 insertions(+), 19 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index ac32ae832..c48e82b0c 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -1042,12 +1042,15 @@ class ApiController extends Zend_Controller_Action { $request = $this->getRequest(); $data = $request->getParam("data"); - $media_id = $request->getParam("media_id"); + $media_id = intval($request->getParam("media_id")); $data_arr = json_decode($data); + + //$media_id is -1 sometimes when a stream has stopped playing + if (!is_null($media_id) && $media_id > 0) { - if (!is_null($media_id)) { - if (isset($data_arr->title) && - strlen($data_arr->title) < 1024) { + if (isset($data_arr->title)) { + + $data_title = substr($data_arr->title, 0, 1024); $previous_metadata = CcWebstreamMetadataQuery::create() ->orderByDbStartTime('desc') @@ -1056,23 +1059,27 @@ class ApiController extends Zend_Controller_Action $do_insert = true; if ($previous_metadata) { - if ($previous_metadata->getDbLiquidsoapData() == $data_arr->title) { - Logging::debug("Duplicate found: ".$data_arr->title); + if ($previous_metadata->getDbLiquidsoapData() == $data_title) { + Logging::debug("Duplicate found: ". $data_title); $do_insert = false; } } if ($do_insert) { + + $startDT = new DateTime("now", new DateTimeZone("UTC")); + $webstream_metadata = new CcWebstreamMetadata(); $webstream_metadata->setDbInstanceId($media_id); - $webstream_metadata->setDbStartTime(new DateTime("now", new DateTimeZone("UTC"))); - $webstream_metadata->setDbLiquidsoapData($data_arr->title); + $webstream_metadata->setDbStartTime($startDT); + $webstream_metadata->setDbLiquidsoapData($data_title); $webstream_metadata->save(); + + $historyService = new Application_Service_HistoryService(); + $historyService->insertWebstreamMetadata($media_id, $startDT, $data_arr); } } - } else { - throw new Exception("Null value of media_id"); - } + } $this->view->response = $data; $this->view->media_id = $media_id; diff --git a/airtime_mvc/application/forms/EditHistoryItem.php b/airtime_mvc/application/forms/EditHistoryItem.php index 16ba5ded5..2f6f38043 100644 --- a/airtime_mvc/application/forms/EditHistoryItem.php +++ b/airtime_mvc/application/forms/EditHistoryItem.php @@ -43,7 +43,7 @@ class Application_Form_EditHistoryItem extends Application_Form_EditHistory $ends->addFilter('StringTrim'); $ends->setLabel(_('End Time')); $ends->setDecorators(array('ViewHelper')); - $ends->setRequired(true); + //$ends->setRequired(true); $this->addElement($ends); } diff --git a/airtime_mvc/application/models/airtime/CcPlayoutHistoryMetaData.php b/airtime_mvc/application/models/airtime/CcPlayoutHistoryMetaData.php index 890a4ca05..b55de6043 100644 --- a/airtime_mvc/application/models/airtime/CcPlayoutHistoryMetaData.php +++ b/airtime_mvc/application/models/airtime/CcPlayoutHistoryMetaData.php @@ -14,5 +14,21 @@ * @package propel.generator.airtime */ class CcPlayoutHistoryMetaData extends BaseCcPlayoutHistoryMetaData { + + /** + * Set the value of [value] column. + * + * @param string $v new value + * @return CcPlayoutHistoryMetaData The current object (for fluent API support) + */ + public function setDbValue($v) + { + //make sure the metadata isn't longer than the DB field. + $v = substr($v, 0, 128); + + parent::setDbValue($v); + + return $this; + } // setDbValue() } // CcPlayoutHistoryMetaData diff --git a/airtime_mvc/application/models/airtime/map/CcPlayoutHistoryTableMap.php b/airtime_mvc/application/models/airtime/map/CcPlayoutHistoryTableMap.php index 6c365d7bb..23696f18d 100644 --- a/airtime_mvc/application/models/airtime/map/CcPlayoutHistoryTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcPlayoutHistoryTableMap.php @@ -41,7 +41,7 @@ class CcPlayoutHistoryTableMap extends TableMap { $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); $this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null); $this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null); - $this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null); + $this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', false, null, null); $this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', false, null, null); // validators } // initialize() diff --git a/airtime_mvc/application/services/HistoryService.php b/airtime_mvc/application/services/HistoryService.php index 4477e28ff..d273e1fb9 100644 --- a/airtime_mvc/application/services/HistoryService.php +++ b/airtime_mvc/application/services/HistoryService.php @@ -290,9 +290,12 @@ class Application_Service_HistoryService $dateTime->setTimezone($timezoneLocal); $result["starts"] = $dateTime->format("Y-m-d H:i:s"); - $dateTime = new DateTime($result["ends"], $timezoneUTC); - $dateTime->setTimezone($timezoneLocal); - $result["ends"] = $dateTime->format("Y-m-d H:i:s"); + //if ends is null we don't want it to default to "now" + if (isset($result["ends"])) { + $dateTime = new DateTime($result["ends"], $timezoneUTC); + $dateTime->setTimezone($timezoneLocal); + $result["ends"] = $dateTime->format("Y-m-d H:i:s"); + } if (isset($result[MDATA_KEY_DURATION])) { $formatter = new LengthFormatter($result[MDATA_KEY_DURATION]); @@ -505,6 +508,48 @@ class Application_Service_HistoryService return $filteredShows; } + + public function insertWebstreamMetadata($schedId, $startDT, $data) { + + $this->con->beginTransaction(); + + try { + + $item = CcScheduleQuery::create()->findPK($schedId, $this->con); + + //TODO figure out how to combine these all into 1 query. + $showInstance = $item->getCcShowInstances($this->con); + $show = $showInstance->getCcShow($this->con); + + $webstream = $item->getCcWebstream($this->con); + + $metadata = array(); + $metadata["showname"] = $show->getDbName(); + $metadata[MDATA_KEY_TITLE] = $data->title; + $metadata[MDATA_KEY_CREATOR] = $webstream->getDbName(); + + $history = new CcPlayoutHistory(); + $history->setDbStarts($startDT); + $history->setDbEnds(null); + $history->setDbInstanceId($item->getDbInstanceId()); + + foreach ($metadata as $key => $val) { + $meta = new CcPlayoutHistoryMetaData(); + $meta->setDbKey($key); + $meta->setDbValue($val); + + $history->addCcPlayoutHistoryMetaData($meta); + } + + $history->save($this->con); + + $this->con->commit(); + } + catch (Exception $e) { + $this->con->rollback(); + throw $e; + } + } public function insertPlayedItem($schedId) { @@ -611,7 +656,7 @@ class Application_Service_HistoryService } //need to convert to the station's local time first. - if ($field["type"] == TEMPLATE_DATETIME) { + if ($field["type"] == TEMPLATE_DATETIME && !is_null($value)) { $timezoneUTC = new DateTimeZone("UTC"); $timezoneLocal = new DateTimeZone($this->timezone); diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index f2a393f1f..d5ba76516 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -483,7 +483,7 @@ - + diff --git a/airtime_mvc/build/sql/schema.sql b/airtime_mvc/build/sql/schema.sql index 8269fec2a..13d1654a5 100644 --- a/airtime_mvc/build/sql/schema.sql +++ b/airtime_mvc/build/sql/schema.sql @@ -765,7 +765,7 @@ CREATE TABLE "cc_playout_history" "id" serial NOT NULL, "file_id" INTEGER, "starts" TIMESTAMP NOT NULL, - "ends" TIMESTAMP NOT NULL, + "ends" TIMESTAMP, "instance_id" INTEGER, PRIMARY KEY ("id") ); From 1fa13eed13f8029361a6c9f1854ab41a44eb868c Mon Sep 17 00:00:00 2001 From: Naomi Date: Mon, 30 Sep 2013 13:59:08 -0400 Subject: [PATCH 08/10] CRLF --- .../application/controllers/ApiController.php | 2 +- .../airtime/CcPlayoutHistoryMetaData.php | 22 ++++----- .../application/services/HistoryService.php | 48 +++++++++---------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index c48e82b0c..992408bf3 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -1075,7 +1075,7 @@ class ApiController extends Zend_Controller_Action $webstream_metadata->setDbLiquidsoapData($data_title); $webstream_metadata->save(); - $historyService = new Application_Service_HistoryService(); + $historyService = new Application_Service_HistoryService(); $historyService->insertWebstreamMetadata($media_id, $startDT, $data_arr); } } diff --git a/airtime_mvc/application/models/airtime/CcPlayoutHistoryMetaData.php b/airtime_mvc/application/models/airtime/CcPlayoutHistoryMetaData.php index b55de6043..9eb4958a2 100644 --- a/airtime_mvc/application/models/airtime/CcPlayoutHistoryMetaData.php +++ b/airtime_mvc/application/models/airtime/CcPlayoutHistoryMetaData.php @@ -15,20 +15,20 @@ */ class CcPlayoutHistoryMetaData extends BaseCcPlayoutHistoryMetaData { - /** - * Set the value of [value] column. - * - * @param string $v new value - * @return CcPlayoutHistoryMetaData The current object (for fluent API support) - */ - public function setDbValue($v) + /** + * Set the value of [value] column. + * + * @param string $v new value + * @return CcPlayoutHistoryMetaData The current object (for fluent API support) + */ + public function setDbValue($v) { - //make sure the metadata isn't longer than the DB field. + //make sure the metadata isn't longer than the DB field. $v = substr($v, 0, 128); - parent::setDbValue($v); - - return $this; + parent::setDbValue($v); + + return $this; } // setDbValue() } // CcPlayoutHistoryMetaData diff --git a/airtime_mvc/application/services/HistoryService.php b/airtime_mvc/application/services/HistoryService.php index d273e1fb9..5566a1acd 100644 --- a/airtime_mvc/application/services/HistoryService.php +++ b/airtime_mvc/application/services/HistoryService.php @@ -511,43 +511,43 @@ class Application_Service_HistoryService public function insertWebstreamMetadata($schedId, $startDT, $data) { - $this->con->beginTransaction(); - + $this->con->beginTransaction(); + try { $item = CcScheduleQuery::create()->findPK($schedId, $this->con); - //TODO figure out how to combine these all into 1 query. - $showInstance = $item->getCcShowInstances($this->con); + //TODO figure out how to combine these all into 1 query. + $showInstance = $item->getCcShowInstances($this->con); $show = $showInstance->getCcShow($this->con); $webstream = $item->getCcWebstream($this->con); - $metadata = array(); + $metadata = array(); $metadata["showname"] = $show->getDbName(); $metadata[MDATA_KEY_TITLE] = $data->title; - $metadata[MDATA_KEY_CREATOR] = $webstream->getDbName(); - - $history = new CcPlayoutHistory(); + $metadata[MDATA_KEY_CREATOR] = $webstream->getDbName(); + + $history = new CcPlayoutHistory(); $history->setDbStarts($startDT); - $history->setDbEnds(null); - $history->setDbInstanceId($item->getDbInstanceId()); - - foreach ($metadata as $key => $val) { - $meta = new CcPlayoutHistoryMetaData(); - $meta->setDbKey($key); - $meta->setDbValue($val); - - $history->addCcPlayoutHistoryMetaData($meta); - } - + $history->setDbEnds(null); + $history->setDbInstanceId($item->getDbInstanceId()); + + foreach ($metadata as $key => $val) { + $meta = new CcPlayoutHistoryMetaData(); + $meta->setDbKey($key); + $meta->setDbValue($val); + + $history->addCcPlayoutHistoryMetaData($meta); + } + $history->save($this->con); - $this->con->commit(); - } - catch (Exception $e) { - $this->con->rollback(); - throw $e; + $this->con->commit(); + } + catch (Exception $e) { + $this->con->rollback(); + throw $e; } } From 8a354a8c4590af8cc7790a62318ce0a028beb2e9 Mon Sep 17 00:00:00 2001 From: Naomi Date: Mon, 30 Sep 2013 14:25:51 -0400 Subject: [PATCH 09/10] CC-5316 : Playout History: Doesn't support webstream --- install_minimal/upgrades/airtime-2.5.0/data/schema.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_minimal/upgrades/airtime-2.5.0/data/schema.sql b/install_minimal/upgrades/airtime-2.5.0/data/schema.sql index 253021b24..a6424446c 100644 --- a/install_minimal/upgrades/airtime-2.5.0/data/schema.sql +++ b/install_minimal/upgrades/airtime-2.5.0/data/schema.sql @@ -31,7 +31,7 @@ CREATE TABLE cc_playout_history ( id integer DEFAULT nextval('cc_playout_history_id_seq'::regclass) NOT NULL, file_id integer, starts timestamp without time zone NOT NULL, - ends timestamp without time zone NOT NULL, + ends timestamp without time zone, instance_id integer ); From a34ae69d4b48da246078154ad9b6924f54650acb Mon Sep 17 00:00:00 2001 From: Naomi Date: Mon, 30 Sep 2013 15:56:26 -0400 Subject: [PATCH 10/10] CC-5347 : Random Error think to do with updating is scheduled status of a webstream not sending a notify message if webstream source is -1 --- python_apps/pypo/liquidsoap_scripts/ls_lib.liq | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq index e2123e26d..e4459600d 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq @@ -16,8 +16,11 @@ def notify_stream(m) #escaping the apostrophe, and then starting a new string right after it. This is why we use 3 apostrophes. json_str = string.replace(pattern="'",(fun (s) -> "'\''"), json_str) command = "/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --webstream='#{json_str}' --media-id=#{!current_dyn_id} &" - log(command) - system(command) + + if !current_dyn_id != "-1" then + log(command) + system(command) + end end # A function applied to each metadata chunk