public function indexAction() { $auth = Zend_Auth::getInstance(); $log = $auth->getIdentity()->NOM_M . " " . $auth->getIdentity()->PRENOM; $this->view->log = $log; $dba = Zend_Registry::get('dba'); $evenements = new Application_Model_Evenement($dba); $evenements_results = $evenements->fetchAll(); $genre_table = new Application_Model_Genre($dba); $genres = $genre_table->fetchAll()->toArray(); $genre_playlist = array(); foreach ($genres as $genre) { $playlist_table = new Application_Model_Playlist($dba); $where = $dba->quoteInto("ID_GENRE = ?", $genre["ID_GENRE"]); $playlists_results = $playlist_table->fetchAll($where)->toArray(); $playlists = array(); foreach ($playlists_results as $playlist) { $playlists[] = array("PLAY_ID" => $playlist["PLAY_ID"], "NOM_PLAY" => $playlist["NOM_PLAY"]); } if (count($playlists) > 0) { $genre_playlist[] = array("ID_GENRE" => $genre["ID_GENRE"], "GENRE" => $genre["NOM_G"], "PLAYLISTS" => $playlists); } } $result = array(); foreach ($evenements_results as $evenement) { $joue_table = new Application_Model_Joue($dba); $select = $joue_table->select()->where("EVENEMENT_ID = ?", $evenement->EVENEMENT_ID); $joue_results = $joue_table->fetchAll($select)->toArray(); $color = "blue"; if ($evenement->ID_EMISSION != NULL) { $color = "red"; } if (count($joue_results) > 0) { $color = "orange"; } $item = array("EVENEMENT_ID" => $evenement->EVENEMENT_ID, "D_H_DEBUT" => $evenement->D_H_DEBUT, "D_H_FIN" => $evenement->D_H_FIN, "NOM_EV" => $evenement->NOM_EV, "COLOR" => $color); $result[] = $item; } $emission_table = new Application_Model_Emission($dba); $select = $emission_table->select()->where("PATH_E IS NOT NULL"); $this->view->podcast = $emission_table->fetchAll($select)->toArray(); $this->view->genre_playlist = $genre_playlist; $this->view->evenements = $result; }
function setup() { global $CC_CONFIG; $con = Propel::getConnection(); // Clear the files table $sql = "DELETE FROM " . $CC_CONFIG["filesTable"]; $con->exec($sql); // Add a file $values = array("filepath" => dirname(__FILE__) . "/test10001.mp3"); $this->storedFile = Application_Model_StoredFile::Insert($values, false); // Add a file $values = array("filepath" => dirname(__FILE__) . "/test10002.mp3"); $this->storedFile2 = Application_Model_StoredFile::Insert($values, false); // Clear the schedule table $sql = "DELETE FROM " . $CC_CONFIG["scheduleTable"]; $con->exec($sql); // Create a playlist $playlist = new Application_Model_Playlist(); $playlist->create("Scheduler Unit Test"); $result = $playlist->addAudioClip($this->storedFile->getId()); $result = $playlist->addAudioClip($this->storedFile2->getId()); $result = $playlist->addAudioClip($this->storedFile2->getId()); // Schedule it $i = new Application_Model_ScheduleGroup(); $this->groupIdCreated = $i->add('2010-11-11 01:30:23', null, $playlist->getId()); }
function testAddAndRemovePlaylist() { // Create a playlist $playlist = new Application_Model_Playlist(); $playlist->create("Scheduler Unit Test " . uniqid()); $result = $playlist->addAudioClip($this->storedFile->getId()); $result = $playlist->addAudioClip($this->storedFile2->getId()); $result = $playlist->addAudioClip($this->storedFile2->getId()); $i = new Application_Model_ScheduleGroup(); $this->groupIdCreated = $i->add('2010-11-11 01:30:23', null, $playlist->getId()); $group = new Application_Model_ScheduleGroup($this->groupIdCreated); if ($group->count() != 3) { $this->fail("Wrong number of items added."); } $items = $group->getItems(); if (!is_array($items) || $items[1]["starts"] != "2010-11-11 01:30:34.231") { $this->fail("Wrong start time for 2nd item."); } $result = $group->remove(); if ($result != 1) { $this->fail("Did not remove item."); } Application_Model_Playlist::Delete($playlist->getId()); }
/** * This function is for when media monitor detects deletion of file * and trying to update airtime side * * @param boolean $p_deleteFile * */ public function deleteByMediaMonitor($deleteFromPlaylist = false) { $filepath = $this->getFilePath(); if ($deleteFromPlaylist) { Application_Model_Playlist::DeleteFileFromAllPlaylists($this->getId()); } // set file_exists flag to false $this->_file->setDbFileExists(false); $this->_file->save(); }
private function retrieveMediaFiles($id, $type) { $files = array(); if ($type === "audioclip") { $file = CcFilesQuery::create()->findPK($id, $this->con); if (is_null($file) || !$file->getDbFileExists()) { throw new Exception("A selected File does not exist!"); } else { $data = $this->fileInfo; $data["id"] = $id; $data["cliplength"] = $file->getDbLength(); $data["cueout"] = $file->getDbLength(); $defaultFade = Application_Model_Preference::GetDefaultFade(); if (isset($defaultFade)) { //fade is in format SS.uuuuuu $data["fadein"] = $defaultFade; $data["fadeout"] = $defaultFade; } $files[] = $data; } } elseif ($type === "playlist") { $pl = new Application_Model_Playlist($id); $contents = $pl->getContents(); foreach ($contents as $plItem) { if ($plItem['type'] == 0) { $data["id"] = $plItem['item_id']; $data["cliplength"] = $plItem['length']; $data["cuein"] = $plItem['cuein']; $data["cueout"] = $plItem['cueout']; $data["fadein"] = $plItem['fadein']; $data["fadeout"] = $plItem['fadeout']; $data["type"] = 0; $files[] = $data; } elseif ($plItem['type'] == 1) { $data["id"] = $plItem['item_id']; $data["cliplength"] = $plItem['length']; $data["cuein"] = $plItem['cuein']; $data["cueout"] = $plItem['cueout']; $data["fadein"] = "00.500000"; //$plItem['fadein']; $data["fadeout"] = "00.500000"; //$plItem['fadeout']; $data["type"] = 1; $files[] = $data; } elseif ($plItem['type'] == 2) { // if it's a block $bl = new Application_Model_Block($plItem['item_id']); if ($bl->isStatic()) { foreach ($bl->getContents() as $track) { $data["id"] = $track['item_id']; $data["cliplength"] = $track['length']; $data["cuein"] = $track['cuein']; $data["cueout"] = $track['cueout']; $data["fadein"] = $track['fadein']; $data["fadeout"] = $track['fadeout']; $data["type"] = 0; $files[] = $data; } } else { $dynamicFiles = $bl->getListOfFilesUnderLimit(); foreach ($dynamicFiles as $fileId => $f) { $file = CcFilesQuery::create()->findPk($fileId); if (isset($file) && $file->getDbFileExists()) { $data["id"] = $file->getDbId(); $data["cliplength"] = $file->getDbLength(); $data["cuein"] = "00:00:00"; $data["cueout"] = $file->getDbLength(); $defaultFade = Application_Model_Preference::GetDefaultFade(); if (isset($defaultFade)) { //fade is in format SS.uuuuuu $data["fadein"] = $defaultFade; $data["fadeout"] = $defaultFade; } $data["type"] = 0; $files[] = $data; } } } } } } elseif ($type == "stream") { //need to return $stream = CcWebstreamQuery::create()->findPK($id, $this->con); if (is_null($stream)) { throw new Exception("A selected File does not exist!"); } else { $data = $this->fileInfo; $data["id"] = $id; $data["cliplength"] = $stream->getDbLength(); $data["cueout"] = $stream->getDbLength(); $data["type"] = 1; $defaultFade = Application_Model_Preference::GetDefaultFade(); if (isset($defaultFade)) { //fade is in format SS.uuuuuu $data["fadein"] = $defaultFade; $data["fadeout"] = $defaultFade; } $files[] = $data; } } elseif ($type == "block") { $bl = new Application_Model_Block($id); if ($bl->isStatic()) { foreach ($bl->getContents() as $track) { $data["id"] = $track['item_id']; $data["cliplength"] = $track['length']; $data["cuein"] = $track['cuein']; $data["cueout"] = $track['cueout']; $data["fadein"] = $track['fadein']; $data["fadeout"] = $track['fadeout']; $data["type"] = 0; $files[] = $data; } } else { $dynamicFiles = $bl->getListOfFilesUnderLimit(); foreach ($dynamicFiles as $fileId => $f) { $file = CcFilesQuery::create()->findPk($fileId); if (isset($file) && $file->getDbFileExists()) { $data["id"] = $file->getDbId(); $data["cliplength"] = $file->getDbLength(); $data["cuein"] = "00:00:00"; $data["cueout"] = $file->getDbLength(); $defaultFade = Application_Model_Preference::GetDefaultFade(); if (isset($defaultFade)) { //fade is in format SS.uuuuuu $data["fadein"] = $defaultFade; $data["fadeout"] = $defaultFade; } $data["type"] = 0; $files[] = $data; } } } } return $files; }
public static function findEntries($con, $displayColumns, $fromTable, $data, $dataProp = "aaData") { $librarySetting = Application_Model_Preference::getCurrentLibraryTableColumnMap(); //$displayColumns[] = 'owner'; // map that maps original column position to db name $current2dbname = array(); // array of search terms $orig2searchTerm = array(); foreach ($data as $key => $d) { if (strstr($key, "mDataProp_")) { list($dump, $index) = explode("_", $key); $current2dbname[$index] = $d; } elseif (strstr($key, "sSearch_")) { list($dump, $index) = explode("_", $key); $orig2searchTerm[$index] = $d; } } // map that maps dbname to searchTerm $dbname2searchTerm = array(); foreach ($current2dbname as $currentPos => $dbname) { $new_index = $librarySetting($currentPos); // TODO : Fix this retarded hack later. Just a band aid for // now at least we print some warnings so that we don't // forget about this -- cc-4462 if (array_key_exists($new_index, $orig2searchTerm)) { $dbname2searchTerm[$dbname] = $orig2searchTerm[$new_index]; } else { Logging::warn("Trying to reorder to unknown index\n printing as much debugging as possible..."); $debug = array('$new_index' => $new_index, '$currentPos' => $currentPos, '$orig2searchTerm' => $orig2searchTerm); Logging::warn($debug); } } $where = array(); /* Holds the parameters for binding after the statement has been prepared */ $params = array(); if (isset($data['advSearch']) && $data['advSearch'] === 'true') { $advancedWhere = self::buildWhereClauseForAdvancedSearch($dbname2searchTerm); if (!empty($advancedWhere['clause'])) { $where[] = join(" AND ", $advancedWhere['clause']); $params = $advancedWhere['params']; } } if ($data["sSearch"] !== "") { $searchTerms = explode(" ", $data["sSearch"]); } $selectorCount = "SELECT COUNT(*) "; $selectorRows = "SELECT " . join(",", $displayColumns) . " "; $sql = $selectorCount . " FROM " . $fromTable; $sqlTotalRows = $sql; if (isset($searchTerms)) { $searchCols = array(); for ($i = 0; $i < $data["iColumns"]; $i++) { if ($data["bSearchable_" . $i] == "true") { $searchCols[] = $data["mDataProp_{$i}"]; } } $outerCond = array(); $simpleWhere = array(); foreach ($searchTerms as $term) { foreach ($searchCols as $col) { $simpleWhere['clause']["simple_" . $col] = "{$col}::text ILIKE :simple_" . $col; $simpleWhere['params']["simple_" . $col] = "%" . $term . "%"; } $outerCond[] = "(" . implode(" OR ", $simpleWhere['clause']) . ")"; } $where[] = "(" . implode(" AND ", $outerCond) . ")"; $params = array_merge($params, $simpleWhere['params']); } // End Where clause // Order By clause $orderby = array(); for ($i = 0; $i < $data["iSortingCols"]; $i++) { $num = $data["iSortCol_" . $i]; $orderby[] = $data["mDataProp_{$num}"] . " " . $data["sSortDir_" . $i]; } $orderby[] = "id"; $orderby = join(",", $orderby); // End Order By clause $displayLength = intval($data["iDisplayLength"]); $needToBind = false; if (count($where) > 0) { $needToBind = true; $where = join(" OR ", $where); $sql = $selectorCount . " FROM " . $fromTable . " WHERE " . $where; $sqlTotalDisplayRows = $sql; $sql = $selectorRows . " FROM " . $fromTable . " WHERE " . $where . " ORDER BY " . $orderby; //limit the results returned. if ($displayLength !== -1) { $sql .= " OFFSET " . $data["iDisplayStart"] . " LIMIT " . $displayLength; } } else { $sql = $selectorRows . " FROM " . $fromTable . " ORDER BY " . $orderby; //limit the results returned. if ($displayLength !== -1) { $sql .= " OFFSET " . $data["iDisplayStart"] . " LIMIT " . $displayLength; } } try { $r = $con->query($sqlTotalRows); $totalRows = $r->fetchColumn(0); if (isset($sqlTotalDisplayRows)) { $totalDisplayRows = Application_Common_Database::prepareAndExecute($sqlTotalDisplayRows, $params, 'column'); } else { $totalDisplayRows = $totalRows; } //TODO if ($needToBind) { $results = Application_Common_Database::prepareAndExecute($sql, $params); } else { $stmt = $con->query($sql); $stmt->setFetchMode(PDO::FETCH_ASSOC); $results = $stmt->fetchAll(); } // we need to go over all items and fix length for playlist // in case the playlist contains dynamic block foreach ($results as &$r) { //this function is also called for Manage Users so in //this case there will be no 'ftype' if (isset($r['ftype'])) { if ($r['ftype'] == 'playlist') { $pl = new Application_Model_Playlist($r['id']); $r['length'] = $pl->getLength(); } elseif ($r['ftype'] == "block") { $bl = new Application_Model_Block($r['id']); $r['bl_type'] = $bl->isStatic() ? 'static' : 'dynamic'; $r['length'] = $bl->getLength(); } } } } catch (Exception $e) { Logging::debug($e->getMessage()); } return array("sEcho" => intval($data["sEcho"]), "iTotalDisplayRecords" => intval($totalDisplayRows), "iTotalRecords" => intval($totalRows), $dataProp => $results); }
public function shuffleAction() { $request = $this->getRequest(); $params = $request->getPost(); try { $pl = new Application_Model_Playlist($params['obj_id']); $result = $pl->shuffle(); if ($result['result'] == 0) { $this->_helper->json->sendJson(array("result" => 0, "html" => $this->createFullResponse($pl, true))); } else { $this->_helper->json->sendJson($result); } } catch (PlaylistNotFoundException $e) { $this->playlistNotFound('block', true); } catch (Exception $e) { $this->playlistUnknownError($e); } }
/** *Function will load and return the contents of the requested playlist. */ public function getPlaylistAction() { // disable the view and the layout $this->view->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $playlistID = $this->_getParam('playlistID'); if (!isset($playlistID)) { return; } $pl = new Application_Model_Playlist($playlistID); $result = array(); foreach ($pl->getContents(true) as $ele) { if ($ele['type'] == 2) { // if element is a block expand and add $bl = new Application_Model_Block($ele['item_id']); if ($bl->isStatic()) { foreach ($bl->getContents(true) as $track) { $result[] = $this->createElementMap($track); } } } else { $result[] = $this->createElementMap($ele); } } $this->_helper->json($result); }
public function getplaygenreAction() { $dba = Zend_Registry::get('dba'); $id = $_GET["id"]; $res = array(); $this->_helper->layout->disableLayout(true); $this->_helper->viewRenderer->setNoRender(true); $playlists_table = new Application_Model_Playlist($dba); $where = $dba->quoteInto("GEN_ID_GENRE = ?", $id); $playlists = $playlists_table->fetchAll()->toArray(); $genres_table = new Application_Model_Genre($dba); $genre = $genres_table->fetchAll($where)->toArray(); foreach ($genre as $g) { foreach ($playlists as $pl) { if ($pl["ID_GENRE"] == $g["ID_GENRE"]) { if ($this->search_g($res, $g["NOM_G"]) == false) { $res[] = $g; } } } } $json = json_encode($res); echo $json; }
public static function GetSystemInfo($returnArray = false, $p_testing = false) { exec('/usr/bin/airtime-check-system --no-color', $output); $output = preg_replace('/\\s+/', ' ', $output); $systemInfoArray = array(); foreach ($output as $key => &$out) { $info = explode('=', $out); if (isset($info[1])) { $key = str_replace(' ', '_', trim($info[0])); $key = strtoupper($key); if ($key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM' || $key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION' || $key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES' || $key == 'PLAYOUT_ENGINE_CPU_PERC') { if ($key == 'AIRTIME_VERSION') { // remove hash tag on the version string $version = explode('+', $info[1]); $systemInfoArray[$key] = $version[0]; } else { $systemInfoArray[$key] = $info[1]; } } } } $outputArray = array(); $outputArray['LIVE_DURATION'] = Application_Model_LiveLog::GetLiveShowDuration($p_testing); $outputArray['SCHEDULED_DURATION'] = Application_Model_LiveLog::GetScheduledDuration($p_testing); $outputArray['SOUNDCLOUD_ENABLED'] = self::GetUploadToSoundcloudOption(); if ($outputArray['SOUNDCLOUD_ENABLED']) { $outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = Application_Model_StoredFile::getSoundCloudUploads(); } else { $outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = NULL; } $outputArray['STATION_NAME'] = self::GetStationName(); $outputArray['PHONE'] = self::GetPhone(); $outputArray['EMAIL'] = self::GetEmail(); $outputArray['STATION_WEB_SITE'] = self::GetStationWebSite(); $outputArray['STATION_COUNTRY'] = self::GetStationCountry(); $outputArray['STATION_CITY'] = self::GetStationCity(); $outputArray['STATION_DESCRIPTION'] = self::GetStationDescription(); // get web server info if (isset($systemInfoArray["AIRTIME_VERSION_URL"])) { $url = $systemInfoArray["AIRTIME_VERSION_URL"]; $index = strpos($url, '/api/'); $url = substr($url, 0, $index); $headerInfo = get_headers(trim($url), 1); $outputArray['WEB_SERVER'] = $headerInfo['Server'][0]; } $outputArray['NUM_OF_USERS'] = Application_Model_User::getUserCount(); $outputArray['NUM_OF_SONGS'] = Application_Model_StoredFile::getFileCount(); $outputArray['NUM_OF_PLAYLISTS'] = Application_Model_Playlist::getPlaylistCount(); $outputArray['NUM_OF_SCHEDULED_PLAYLISTS'] = Application_Model_Schedule::getSchduledPlaylistCount(); $outputArray['NUM_OF_PAST_SHOWS'] = Application_Model_ShowInstance::GetShowInstanceCount(gmdate("Y-m-d H:i:s")); $outputArray['UNIQUE_ID'] = self::GetUniqueId(); $outputArray['SAAS'] = self::GetPlanLevel(); if ($outputArray['SAAS'] != 'disabled') { $outputArray['TRIAL_END_DATE'] = self::GetTrialEndingDate(); } else { $outputArray['TRIAL_END_DATE'] = NULL; } $outputArray['INSTALL_METHOD'] = self::GetInstallMethod(); $outputArray['NUM_OF_STREAMS'] = self::GetNumOfStreams(); $outputArray['STREAM_INFO'] = Application_Model_StreamSetting::getStreamInfoForDataCollection(); $outputArray = array_merge($systemInfoArray, $outputArray); $outputString = "\n"; foreach ($outputArray as $key => $out) { if ($key == 'TRIAL_END_DATE' && ($out != '' || $out != 'NULL')) { continue; } if ($key == "STREAM_INFO") { $outputString .= $key . " :\n"; foreach ($out as $s_info) { foreach ($s_info as $k => $v) { $outputString .= "\t" . strtoupper($k) . " : " . $v . "\n"; } } } elseif ($key == "SOUNDCLOUD_ENABLED") { if ($out) { $outputString .= $key . " : TRUE\n"; } elseif (!$out) { $outputString .= $key . " : FALSE\n"; } } elseif ($key == "SAAS") { if (strcmp($out, 'disabled') != 0) { $outputString .= $key . ' : ' . $out . "\n"; } } else { $outputString .= $key . ' : ' . $out . "\n"; } } if ($returnArray) { $outputArray['PROMOTE'] = self::GetPublicise(); $outputArray['LOGOIMG'] = self::GetStationLogo(); return $outputArray; } else { return $outputString; } }
public function deleteAction() { $dba = Zend_Registry::get('dba'); $id = $_GET["id"]; $type = $_GET["type"]; $dans_playlist_table = new Application_Model_DansPlaylist($dba); if ($type == "musique") { $where = $dba->quoteInto("ID_MUSIQUE = ?", $id); $dans_playlist_table->delete($where); } else { $where = $dba->quoteInto("PLAY_ID = ?", $id); $dans_playlist_table->delete($where); $playlist_table = new Application_Model_Playlist($dba); $playlist_table->delete($where); } $this->_helper->viewRenderer->setNoRender(true); }
public function deleteAction() { $ids = $this->_getParam('ids'); $ids = !is_array($ids) ? array($ids) : $ids; $type = $this->_getParam('type'); $obj = null; $objInfo = Application_Model_Library::getObjInfo($type); $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME); try { Logging::info("Currently active {$type} {$obj_sess->id}"); if (in_array($obj_sess->id, $ids)) { Logging::info("Deleting currently active {$type}"); Application_Model_Library::changePlaylist(null, $type); } else { Logging::info("Not deleting currently active {$type}"); $obj = new $objInfo['className']($obj_sess->id); } if (strcmp($objInfo['className'], 'Application_Model_Playlist') == 0) { Application_Model_Playlist::deletePlaylists($ids, $userInfo->id); } else { Application_Model_Block::deleteBlocks($ids, $userInfo->id); } $this->createFullResponse($obj); } catch (PlaylistNoPermissionException $e) { $this->playlistNoPermission($type); } catch (BlockNoPermissionException $e) { $this->playlistNoPermission($type); } catch (PlaylistNotFoundException $e) { $this->playlistNotFound($type); } catch (Exception $e) { $this->playlistUnknownError($e); } }
public function getFileMetadataAction() { $id = $this->_getParam('id'); $type = $this->_getParam('type'); try { if ($type == "audioclip") { $file = Application_Model_StoredFile::Recall($id); $this->view->type = $type; $md = $file->getMetadata(); foreach ($md as $key => $value) { if ($key == 'MDATA_KEY_DIRECTORY') { $musicDir = Application_Model_MusicDir::getDirByPK($value); $md['MDATA_KEY_FILEPATH'] = Application_Common_OsPath::join($musicDir->getDirectory(), $md['MDATA_KEY_FILEPATH']); } } $formatter = new SamplerateFormatter($md["MDATA_KEY_SAMPLERATE"]); $md["MDATA_KEY_SAMPLERATE"] = $formatter->format(); $formatter = new BitrateFormatter($md["MDATA_KEY_BITRATE"]); $md["MDATA_KEY_BITRATE"] = $formatter->format(); $formatter = new LengthFormatter($md["MDATA_KEY_DURATION"]); $md["MDATA_KEY_DURATION"] = $formatter->format(); $this->view->md = $md; } elseif ($type == "playlist") { $file = new Application_Model_Playlist($id); $this->view->type = $type; $md = $file->getAllPLMetaData(); $formatter = new LengthFormatter($md["dcterms:extent"]); $md["dcterms:extent"] = $formatter->format(); $this->view->md = $md; $this->view->contents = $file->getContents(); } elseif ($type == "block") { $block = new Application_Model_Block($id); $this->view->type = $type; $md = $block->getAllPLMetaData(); $formatter = new LengthFormatter($md["dcterms:extent"]); $md["dcterms:extent"] = $formatter->format(); $this->view->md = $md; if ($block->isStatic()) { $this->view->blType = 'Static'; $this->view->contents = $block->getContents(); } else { $this->view->blType = 'Dynamic'; $this->view->contents = $block->getCriteria(); } $this->view->block = $block; } elseif ($type == "stream") { $webstream = CcWebstreamQuery::create()->findPK($id); $ws = new Application_Model_Webstream($webstream); $md = $ws->getMetadata(); $this->view->md = $md; $this->view->type = $type; } } catch (Exception $e) { Logging::info($e->getMessage()); } }
public static function setIsPlaylist($p_playlistItems, $p_type, $p_status) { foreach ($p_playlistItems as $item) { $file = self::RecallById($item->getDbFileId()); $fileId = $file->_file->getDbId(); if ($p_type == 'playlist') { // we have to check if the file is in another playlist before // we can update if (!is_null($fileId) && !in_array($fileId, Application_Model_Playlist::getAllPlaylistFiles())) { $file->_file->setDbIsPlaylist($p_status)->save(); } } elseif ($p_type == 'block') { if (!is_null($fileId) && !in_array($fileId, Application_Model_Block::getAllBlockFiles())) { $file->_file->setDbIsPlaylist($p_status)->save(); } } } }