/** * Remove the group from the schedule. * Note: does not check if it is in the past, you can remove anything. * * @return boolean * TRUE on success, false if there is no group ID defined. */ public function remove() { global $CC_CONFIG, $CC_DBC; if (is_null($this->groupId) || !is_numeric($this->groupId)) { return false; } $sql = "DELETE FROM " . $CC_CONFIG["scheduleTable"] . " WHERE group_id = " . $this->groupId; //echo $sql; $retVal = $CC_DBC->query($sql); RabbitMq::PushSchedule(); return $retVal; }
/** * Sets a flag to push the schedule at the end of the request. */ public static function PushSchedule() { RabbitMq::$doPush = TRUE; }
public function dispatchLoopShutdown() { RabbitMq::PushScheduleFinal(); }
public function deleteShow() { // see if it was recording show $recording = CcShowInstancesQuery::create()->findPK($this->_instanceId)->getDbRecord(); CcShowInstancesQuery::create()->findPK($this->_instanceId)->delete(); RabbitMq::PushSchedule(); if ($recording) { RabbitMq::SendMessageToShowRecorder("cancel_recording"); } }
//echo "show created, ID: $showId\n"; // populating the show with a playlist $instances = Show::getShows($showTime->format("Y-m-d H:i:s"), $showTime->format("Y-m-d H:i:s")); $instance = array_pop($instances); $show = new ShowInstance($instance["instance_id"]); //echo "Adding playlist to show instance ".$show->getShowInstanceId()."\n"; $show->scheduleShow(array(1)); //echo "done\n"; //$show->scheduleShow(array($playlist->getId())); } $showTime = new DateTime(); $resolution = "hour"; $showNumber = 1; $numberOfDays = 180; $numberOfHours = 0; $endDate = new DateTime(); $endDate->add(new DateInterval("P" . $numberOfDays . "DT" . $numberOfHours . "H")); echo "End date: " . $endDate->format("Y-m-d H:i") . "\n"; while ($showTime < $endDate) { echo $showTime->format("Y-m-d H:i") . " < " . $endDate->format("Y-m-d H:i") . "\n"; if ($resolution == "minute") { createTestShow($showNumber, $showTime, "0:01"); $showTime->add(new DateInterval("PT1M")); } elseif ($resolution == "hour") { createTestShow($showNumber, $showTime); $showTime->add(new DateInterval("PT1H")); } $showNumber = $showNumber + 1; } RabbitMq::PushScheduleFinal();
public function editFileMdAction() { $request = $this->getRequest(); $form = new Application_Form_EditAudioMD(); $file_id = $this->_getParam('id', null); $file = StoredFile::Recall($file_id); if ($request->isPost()) { if ($form->isValid($request->getPost())) { $formdata = $form->getValues(); $file->setDbColMetadata($formdata); $data = $file->getMetadata(); RabbitMq::SendMessageToMediaMonitor("md_update", $data); $this->_helper->redirector('index'); } } $form->populate($file->getDbColMetadata()); $this->view->form = $form; }
public static function SetStreamLabelFormat($type) { Application_Model_Preference::SetValue("stream_label_format", $type); RabbitMq::PushSchedule(); }
public static function removeWatchedDir($p_dir) { $p_dir = realpath($p_dir) . "/"; $dir = MusicDir::getDirByPath($p_dir); if ($dir == NULL) { return array("code" => 1, "error" => "'{$p_dir}' doesn't exist in the watched list."); } else { $dir->remove(); $data = array(); $data["directory"] = $p_dir; RabbitMq::SendMessageToMediaMonitor("remove_watch", $data); return array("code" => 0); } }