diff --git a/.zfproject.xml b/.zfproject.xml index 1ff9e39145..1f805497f6 100644 --- a/.zfproject.xml +++ b/.zfproject.xml @@ -36,7 +36,7 @@ - + @@ -304,7 +304,7 @@ - + diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php index a177b7df2c..184e2a0ff6 100644 --- a/airtime_mvc/application/controllers/LibraryController.php +++ b/airtime_mvc/application/controllers/LibraryController.php @@ -17,7 +17,7 @@ public function init() ->addActionContext('delete', 'json') ->addActionContext('delete-group', 'json') ->addActionContext('context-menu', 'json') - ->addActionContext('get-file-meta-data', 'html') + ->addActionContext('get-file-metadata', 'html') ->addActionContext('upload-file-soundcloud', 'json') ->addActionContext('get-upload-to-soundcloud-status', 'json') ->addActionContext('set-num-entries', 'json') @@ -91,6 +91,24 @@ public function contextMenuAction() if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete"); } + } else if ($type == "stream") { + + $obj = new Application_Model_Webstream($id); + if (isset($this->obj_sess->id) && $screen == "playlist") { + if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { + if ($this->obj_sess->type === "playlist") { + $menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy"); + } else { + $menu["pl_add"] = array("name"=> "Add to Smart Playlist", "icon" => "add-playlist", "icon" => "copy"); + } + } + } + if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { + $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete"); + $menu["edit"] = array("name"=> "Edit", "icon" => "edit", "url" => "/library/edit-file-md/id/{$id}"); + } + + } //SOUNDCLOUD MENU OPTIONS @@ -132,6 +150,7 @@ public function deleteAction() $files = array(); $playlists = array(); $blocks = array(); + $streams = array(); $message = null; @@ -143,20 +162,32 @@ public function deleteAction() $playlists[] = intval($media["id"]); } elseif ($media["type"] === "block") { $blocks[] = intval($media["id"]); + } elseif ($media["type"] === "stream") { + $streams[] = intval($media["id"]); } } try { - if ($media["type"] === "playlist") { - Application_Model_Playlist::deletePlaylists($playlists, $user->getId()); - } elseif ($media["type"] === "block") { - Application_Model_Block::deleteBlocks($blocks, $user->getId()); - } + Application_Model_Playlist::deletePlaylists($playlists, $user->getId()); } catch (PlaylistNoPermissionException $e) { $this->view->message = "You don't have permission to delete selected items."; return; } + + try { + Application_Model_Block::deleteBlocks($blocks, $user->getId()); + } catch (Exception $e) { + //TODO: warn user that not all blocks could be deleted. + } + + try { + Application_Model_Webstream::deleteStreams($streams, $user->getId()); + } catch (Exception $e) { + //TODO: warn user that not all streams could be deleted. + Logging::log($e); + } + foreach ($files as $id) { $file = Application_Model_StoredFile::Recall($id); @@ -164,9 +195,8 @@ public function deleteAction() if (isset($file)) { try { $res = $file->delete(true); - } - //could throw a scheduled in future exception. - catch (Exception $e) { + } catch (Exception $e) { + //could throw a scheduled in future exception. $message = "Could not delete some scheduled files."; } } @@ -241,7 +271,7 @@ public function editFileMdAction() $this->view->form = $form; } - public function getFileMetaDataAction() + public function getFileMetadataAction() { $id = $this->_getParam('id'); $type = $this->_getParam('type'); @@ -270,7 +300,7 @@ public function getFileMetaDataAction() $this->view->md = $md; - } elseif ($type == "playlist") { + } else if ($type == "playlist") { $file = new Application_Model_Playlist($id); $this->view->type = $type; @@ -281,6 +311,13 @@ public function getFileMetaDataAction() $this->view->md = $md; $this->view->contents = $file->getContents(); + } else if ($type == "stream") { + $file = new Application_Model_Webstream($id); + + $md = $file->getMetadata(); + + $this->view->md = $md; + $this->view->type = $type; } } catch (Exception $e) { Logging::log($e->getMessage()); diff --git a/airtime_mvc/application/controllers/WebstreamController.php b/airtime_mvc/application/controllers/WebstreamController.php index 63fe2aaa62..6931f732bd 100644 --- a/airtime_mvc/application/controllers/WebstreamController.php +++ b/airtime_mvc/application/controllers/WebstreamController.php @@ -29,19 +29,12 @@ public function newAction() */ } - public function saveAction(){ + public function saveAction() + { $request = $this->getRequest(); Application_Model_Webstream::save($request); - $this->view->x = "hi"; - - - //http://localhost/Library/contents-feed - // 1) Create Propel object and save these parameters - // 2) Make these appear in the library - // 3) Make Web streams + playlists draggable. - // 4) } } diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 751bf6fd30..f660fea34d 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -178,7 +178,7 @@ public function getContents($filterFiles=false) JOIN cc_files AS f ON pc.file_id=f.id WHERE pc.playlist_id = {$this->id} AND type = 0) UNION ALL (SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, -ws.id as item_id, (ws.name || ': ' || ws.url) as title, ws.login as creator, 't'::boolean as exists, ws.url as path FROM cc_playlistcontents AS pc +ws.id as item_id, (ws.name || ': ' || ws.url) as title, ws.creator_id as creator, 't'::boolean as exists, ws.url as path FROM cc_playlistcontents AS pc JOIN cc_webstream AS ws on pc.stream_id=ws.id WHERE pc.playlist_id = {$this->id} AND type = 1) UNION ALL (SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 57724cab69..92969e5bf0 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -621,7 +621,7 @@ public static function searchLibraryFiles($datatables) $plSelect[] = "login AS ".$key; $blSelect[] = "login AS ".$key; $fileSelect[] = $key; - $streamSelect[] = "login AS ".$key; + $streamSelect[] = "creator_id AS ".$key; } //same columns in each table. else if (in_array($key, array("length", "utime", "mtime"))) { diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php index 1380f4ce7f..3663b489d5 100644 --- a/airtime_mvc/application/models/Webstream.php +++ b/airtime_mvc/application/models/Webstream.php @@ -2,6 +2,13 @@ class Application_Model_Webstream{ + private $id; + + public function __construct($id) + { + $this->id = $id; + } + public static function getName() { return "Default"; @@ -27,6 +34,48 @@ public static function getDescription() return "desc"; } + public function getMetadata() + { + $webstream = CcWebstreamQuery::create()->findPK($this->id); + $subjs = CcSubjsQuery::create()->findPK($webstream->getDbCreatorId()); + + $username = $subjs->getDbLogin(); + return array( + "name" => $webstream->getDbName(), + "length" => $webstream->getDbLength(), + "description" => $webstream->getDbDescription(), + "login"=> $username, + "url" => $webstream->getDbUrl(), + ); + + } + + public static function deleteStreams($p_ids, $p_userId) + { + $leftOver = self::streamsNotOwnedByUser($p_ids, $p_userId); + if (count($leftOver) == 0) { + CcWebstreamQuery::create()->findPKs($p_ids)->delete(); + } else { + throw new Exception("Invalid user permissions"); + } + } + + // This function returns that are not owen by $p_user_id among $p_ids + private static function streamsNotOwnedByUser($p_ids, $p_userId) + { + $ownedByUser = CcWebstreamQuery::create()->filterByDbCreatorId($p_userId)->find()->getData(); + $ownedStreams = array(); + foreach ($ownedByUser as $pl) { + if (in_array($pl->getDbId(), $p_ids)) { + $ownedStreams[] = $pl->getDbId(); + } + } + + $leftOvers = array_diff($p_ids, $ownedStreams); + return $leftOvers; + + } + public static function save($request) { Logging::log($request->getParams()); @@ -47,7 +96,7 @@ public static function save($request) $webstream->setDbUrl($request->getParam("url")); $webstream->setDbLength($dblength); - $webstream->setDbLogin($userInfo->id); + $webstream->setDbCreatorId($userInfo->id); $webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC'))); $webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC'))); $webstream->save(); diff --git a/airtime_mvc/application/models/airtime/map/CcWebstreamTableMap.php b/airtime_mvc/application/models/airtime/map/CcWebstreamTableMap.php index 05bd0c3fa1..1b475e6758 100644 --- a/airtime_mvc/application/models/airtime/map/CcWebstreamTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcWebstreamTableMap.php @@ -43,7 +43,7 @@ public function initialize() $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', true, 255, null); $this->addColumn('URL', 'DbUrl', 'VARCHAR', true, 255, null); $this->addColumn('LENGTH', 'DbLength', 'VARCHAR', true, null, '00:00:00'); - $this->addColumn('LOGIN', 'DbLogin', 'VARCHAR', true, 255, null); + $this->addColumn('CREATOR_ID', 'DbCreatorId', 'VARCHAR', true, 255, null); $this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', true, 6, null); $this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', true, 6, null); // validators diff --git a/airtime_mvc/application/models/airtime/om/BaseCcWebstream.php b/airtime_mvc/application/models/airtime/om/BaseCcWebstream.php index e61d5c24c1..eccecf6503 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcWebstream.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcWebstream.php @@ -56,10 +56,10 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent protected $length; /** - * The value for the login field. + * The value for the creator_id field. * @var string */ - protected $login; + protected $creator_id; /** * The value for the mtime field. @@ -164,13 +164,13 @@ public function getDbLength() } /** - * Get the [login] column value. + * Get the [creator_id] column value. * * @return string */ - public function getDbLogin() + public function getDbCreatorId() { - return $this->login; + return $this->creator_id; } /** @@ -340,24 +340,24 @@ public function setDbLength($v) } // setDbLength() /** - * Set the value of [login] column. + * Set the value of [creator_id] column. * * @param string $v new value * @return CcWebstream The current object (for fluent API support) */ - public function setDbLogin($v) + public function setDbCreatorId($v) { if ($v !== null) { $v = (string) $v; } - if ($this->login !== $v) { - $this->login = $v; - $this->modifiedColumns[] = CcWebstreamPeer::LOGIN; + if ($this->creator_id !== $v) { + $this->creator_id = $v; + $this->modifiedColumns[] = CcWebstreamPeer::CREATOR_ID; } return $this; - } // setDbLogin() + } // setDbCreatorId() /** * Sets the value of [mtime] column to a normalized version of the date/time value specified. @@ -498,7 +498,7 @@ public function hydrate($row, $startcol = 0, $rehydrate = false) $this->description = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; $this->url = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; $this->length = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->login = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; + $this->creator_id = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; $this->mtime = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; $this->utime = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; $this->resetModified(); @@ -842,7 +842,7 @@ public function getByPosition($pos) return $this->getDbLength(); break; case 5: - return $this->getDbLogin(); + return $this->getDbCreatorId(); break; case 6: return $this->getDbMtime(); @@ -878,7 +878,7 @@ public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColum $keys[2] => $this->getDbDescription(), $keys[3] => $this->getDbUrl(), $keys[4] => $this->getDbLength(), - $keys[5] => $this->getDbLogin(), + $keys[5] => $this->getDbCreatorId(), $keys[6] => $this->getDbMtime(), $keys[7] => $this->getDbUtime(), ); @@ -928,7 +928,7 @@ public function setByPosition($pos, $value) $this->setDbLength($value); break; case 5: - $this->setDbLogin($value); + $this->setDbCreatorId($value); break; case 6: $this->setDbMtime($value); @@ -965,7 +965,7 @@ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) if (array_key_exists($keys[2], $arr)) $this->setDbDescription($arr[$keys[2]]); if (array_key_exists($keys[3], $arr)) $this->setDbUrl($arr[$keys[3]]); if (array_key_exists($keys[4], $arr)) $this->setDbLength($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbLogin($arr[$keys[5]]); + if (array_key_exists($keys[5], $arr)) $this->setDbCreatorId($arr[$keys[5]]); if (array_key_exists($keys[6], $arr)) $this->setDbMtime($arr[$keys[6]]); if (array_key_exists($keys[7], $arr)) $this->setDbUtime($arr[$keys[7]]); } @@ -984,7 +984,7 @@ public function buildCriteria() if ($this->isColumnModified(CcWebstreamPeer::DESCRIPTION)) $criteria->add(CcWebstreamPeer::DESCRIPTION, $this->description); if ($this->isColumnModified(CcWebstreamPeer::URL)) $criteria->add(CcWebstreamPeer::URL, $this->url); if ($this->isColumnModified(CcWebstreamPeer::LENGTH)) $criteria->add(CcWebstreamPeer::LENGTH, $this->length); - if ($this->isColumnModified(CcWebstreamPeer::LOGIN)) $criteria->add(CcWebstreamPeer::LOGIN, $this->login); + if ($this->isColumnModified(CcWebstreamPeer::CREATOR_ID)) $criteria->add(CcWebstreamPeer::CREATOR_ID, $this->creator_id); if ($this->isColumnModified(CcWebstreamPeer::MTIME)) $criteria->add(CcWebstreamPeer::MTIME, $this->mtime); if ($this->isColumnModified(CcWebstreamPeer::UTIME)) $criteria->add(CcWebstreamPeer::UTIME, $this->utime); @@ -1052,7 +1052,7 @@ public function copyInto($copyObj, $deepCopy = false) $copyObj->setDbDescription($this->description); $copyObj->setDbUrl($this->url); $copyObj->setDbLength($this->length); - $copyObj->setDbLogin($this->login); + $copyObj->setDbCreatorId($this->creator_id); $copyObj->setDbMtime($this->mtime); $copyObj->setDbUtime($this->utime); @@ -1281,7 +1281,7 @@ public function clear() $this->description = null; $this->url = null; $this->length = null; - $this->login = null; + $this->creator_id = null; $this->mtime = null; $this->utime = null; $this->alreadyInSave = false; diff --git a/airtime_mvc/application/models/airtime/om/BaseCcWebstreamPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcWebstreamPeer.php index feba2bc19a..0839a8f9b1 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcWebstreamPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcWebstreamPeer.php @@ -46,8 +46,8 @@ abstract class BaseCcWebstreamPeer { /** the column name for the LENGTH field */ const LENGTH = 'cc_webstream.LENGTH'; - /** the column name for the LOGIN field */ - const LOGIN = 'cc_webstream.LOGIN'; + /** the column name for the CREATOR_ID field */ + const CREATOR_ID = 'cc_webstream.CREATOR_ID'; /** the column name for the MTIME field */ const MTIME = 'cc_webstream.MTIME'; @@ -71,11 +71,11 @@ abstract class BaseCcWebstreamPeer { * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbDescription', 'DbUrl', 'DbLength', 'DbLogin', 'DbMtime', 'DbUtime', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbDescription', 'dbUrl', 'dbLength', 'dbLogin', 'dbMtime', 'dbUtime', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::DESCRIPTION, self::URL, self::LENGTH, self::LOGIN, self::MTIME, self::UTIME, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'DESCRIPTION', 'URL', 'LENGTH', 'LOGIN', 'MTIME', 'UTIME', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'description', 'url', 'length', 'login', 'mtime', 'utime', ), + BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbDescription', 'DbUrl', 'DbLength', 'DbCreatorId', 'DbMtime', 'DbUtime', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbDescription', 'dbUrl', 'dbLength', 'dbCreatorId', 'dbMtime', 'dbUtime', ), + BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::DESCRIPTION, self::URL, self::LENGTH, self::CREATOR_ID, self::MTIME, self::UTIME, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'DESCRIPTION', 'URL', 'LENGTH', 'CREATOR_ID', 'MTIME', 'UTIME', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'description', 'url', 'length', 'creator_id', 'mtime', 'utime', ), BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) ); @@ -86,11 +86,11 @@ abstract class BaseCcWebstreamPeer { * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbDescription' => 2, 'DbUrl' => 3, 'DbLength' => 4, 'DbLogin' => 5, 'DbMtime' => 6, 'DbUtime' => 7, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbDescription' => 2, 'dbUrl' => 3, 'dbLength' => 4, 'dbLogin' => 5, 'dbMtime' => 6, 'dbUtime' => 7, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::DESCRIPTION => 2, self::URL => 3, self::LENGTH => 4, self::LOGIN => 5, self::MTIME => 6, self::UTIME => 7, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'DESCRIPTION' => 2, 'URL' => 3, 'LENGTH' => 4, 'LOGIN' => 5, 'MTIME' => 6, 'UTIME' => 7, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'description' => 2, 'url' => 3, 'length' => 4, 'login' => 5, 'mtime' => 6, 'utime' => 7, ), + BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbDescription' => 2, 'DbUrl' => 3, 'DbLength' => 4, 'DbCreatorId' => 5, 'DbMtime' => 6, 'DbUtime' => 7, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbDescription' => 2, 'dbUrl' => 3, 'dbLength' => 4, 'dbCreatorId' => 5, 'dbMtime' => 6, 'dbUtime' => 7, ), + BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::DESCRIPTION => 2, self::URL => 3, self::LENGTH => 4, self::CREATOR_ID => 5, self::MTIME => 6, self::UTIME => 7, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'DESCRIPTION' => 2, 'URL' => 3, 'LENGTH' => 4, 'CREATOR_ID' => 5, 'MTIME' => 6, 'UTIME' => 7, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'description' => 2, 'url' => 3, 'length' => 4, 'creator_id' => 5, 'mtime' => 6, 'utime' => 7, ), BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) ); @@ -168,7 +168,7 @@ public static function addSelectColumns(Criteria $criteria, $alias = null) $criteria->addSelectColumn(CcWebstreamPeer::DESCRIPTION); $criteria->addSelectColumn(CcWebstreamPeer::URL); $criteria->addSelectColumn(CcWebstreamPeer::LENGTH); - $criteria->addSelectColumn(CcWebstreamPeer::LOGIN); + $criteria->addSelectColumn(CcWebstreamPeer::CREATOR_ID); $criteria->addSelectColumn(CcWebstreamPeer::MTIME); $criteria->addSelectColumn(CcWebstreamPeer::UTIME); } else { @@ -177,7 +177,7 @@ public static function addSelectColumns(Criteria $criteria, $alias = null) $criteria->addSelectColumn($alias . '.DESCRIPTION'); $criteria->addSelectColumn($alias . '.URL'); $criteria->addSelectColumn($alias . '.LENGTH'); - $criteria->addSelectColumn($alias . '.LOGIN'); + $criteria->addSelectColumn($alias . '.CREATOR_ID'); $criteria->addSelectColumn($alias . '.MTIME'); $criteria->addSelectColumn($alias . '.UTIME'); } diff --git a/airtime_mvc/application/models/airtime/om/BaseCcWebstreamQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcWebstreamQuery.php index 3fcec705c2..0798a8e16d 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcWebstreamQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcWebstreamQuery.php @@ -11,7 +11,7 @@ * @method CcWebstreamQuery orderByDbDescription($order = Criteria::ASC) Order by the description column * @method CcWebstreamQuery orderByDbUrl($order = Criteria::ASC) Order by the url column * @method CcWebstreamQuery orderByDbLength($order = Criteria::ASC) Order by the length column - * @method CcWebstreamQuery orderByDbLogin($order = Criteria::ASC) Order by the login column + * @method CcWebstreamQuery orderByDbCreatorId($order = Criteria::ASC) Order by the creator_id column * @method CcWebstreamQuery orderByDbMtime($order = Criteria::ASC) Order by the mtime column * @method CcWebstreamQuery orderByDbUtime($order = Criteria::ASC) Order by the utime column * @@ -20,7 +20,7 @@ * @method CcWebstreamQuery groupByDbDescription() Group by the description column * @method CcWebstreamQuery groupByDbUrl() Group by the url column * @method CcWebstreamQuery groupByDbLength() Group by the length column - * @method CcWebstreamQuery groupByDbLogin() Group by the login column + * @method CcWebstreamQuery groupByDbCreatorId() Group by the creator_id column * @method CcWebstreamQuery groupByDbMtime() Group by the mtime column * @method CcWebstreamQuery groupByDbUtime() Group by the utime column * @@ -40,7 +40,7 @@ * @method CcWebstream findOneByDbDescription(string $description) Return the first CcWebstream filtered by the description column * @method CcWebstream findOneByDbUrl(string $url) Return the first CcWebstream filtered by the url column * @method CcWebstream findOneByDbLength(string $length) Return the first CcWebstream filtered by the length column - * @method CcWebstream findOneByDbLogin(string $login) Return the first CcWebstream filtered by the login column + * @method CcWebstream findOneByDbCreatorId(string $creator_id) Return the first CcWebstream filtered by the creator_id column * @method CcWebstream findOneByDbMtime(string $mtime) Return the first CcWebstream filtered by the mtime column * @method CcWebstream findOneByDbUtime(string $utime) Return the first CcWebstream filtered by the utime column * @@ -49,7 +49,7 @@ * @method array findByDbDescription(string $description) Return CcWebstream objects filtered by the description column * @method array findByDbUrl(string $url) Return CcWebstream objects filtered by the url column * @method array findByDbLength(string $length) Return CcWebstream objects filtered by the length column - * @method array findByDbLogin(string $login) Return CcWebstream objects filtered by the login column + * @method array findByDbCreatorId(string $creator_id) Return CcWebstream objects filtered by the creator_id column * @method array findByDbMtime(string $mtime) Return CcWebstream objects filtered by the mtime column * @method array findByDbUtime(string $utime) Return CcWebstream objects filtered by the utime column * @@ -267,25 +267,25 @@ public function filterByDbLength($dbLength = null, $comparison = null) } /** - * Filter the query on the login column + * Filter the query on the creator_id column * - * @param string $dbLogin The value to use as filter. + * @param string $dbCreatorId The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CcWebstreamQuery The current query, for fluid interface */ - public function filterByDbLogin($dbLogin = null, $comparison = null) + public function filterByDbCreatorId($dbCreatorId = null, $comparison = null) { if (null === $comparison) { - if (is_array($dbLogin)) { + if (is_array($dbCreatorId)) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLogin)) { - $dbLogin = str_replace('*', '%', $dbLogin); + } elseif (preg_match('/[\%\*]/', $dbCreatorId)) { + $dbCreatorId = str_replace('*', '%', $dbCreatorId); $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(CcWebstreamPeer::LOGIN, $dbLogin, $comparison); + return $this->addUsingAlias(CcWebstreamPeer::CREATOR_ID, $dbCreatorId, $comparison); } /** diff --git a/airtime_mvc/application/views/scripts/library/get-file-meta-data.ajax.phtml b/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml similarity index 84% rename from airtime_mvc/application/views/scripts/library/get-file-meta-data.ajax.phtml rename to airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml index 87cefbb559..9eb4414122 100644 --- a/airtime_mvc/application/views/scripts/library/get-file-meta-data.ajax.phtml +++ b/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml @@ -37,3 +37,14 @@ + +type == "stream") : ?> + +
Name:md["name"]);?>
+
Length:md["length"]);?>
+
Creator:md["login"]);?>
+
Description:md["description"]);?>
+
URL:md["url"]);?>
+ + + diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index 2d349f8098..5e2045d0f5 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -419,7 +419,7 @@ - + diff --git a/airtime_mvc/build/sql/schema.sql b/airtime_mvc/build/sql/schema.sql index 303225ffed..a346ecdae0 100644 --- a/airtime_mvc/build/sql/schema.sql +++ b/airtime_mvc/build/sql/schema.sql @@ -635,7 +635,7 @@ CREATE TABLE "cc_webstream" "description" VARCHAR(255) NOT NULL, "url" VARCHAR(255) NOT NULL, "length" interval default '00:00:00' NOT NULL, - "login" VARCHAR(255) NOT NULL, + "creator_id" VARCHAR(255) NOT NULL, "mtime" TIMESTAMP(6) NOT NULL, "utime" TIMESTAMP(6) NOT NULL, PRIMARY KEY ("id") diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 2c408d837b..64eafd68d4 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -464,7 +464,7 @@ var AIRTIME = (function(AIRTIME) { text: aData.track_title }, ajax: { - url: "/Library/get-file-meta-data", + url: "/Library/get-file-metadata", type: "get", data: ({format: "html", id : aData.id, type: aData.ftype}), success: function(data, status) { @@ -614,6 +614,7 @@ var AIRTIME = (function(AIRTIME) { } else { callback = function() { + //TODO AIRTIME.playlist.fnEdit(data.id, data.ftype); }; } diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index c1699b3e52..b7f1051f04 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -503,7 +503,9 @@ var AIRTIME = (function(AIRTIME){ $.post(url, {format: "json", description: description, url:streamurl, length: length, name: name}, function(json){ - console.log(json); + $("#side_playlist") + .empty() + .append("WHAT SHOULD I PUT HERE??!?!! :)"); /* if (json.error !== undefined){