diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 6ff7c4e37..ed4140b46 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -38,10 +38,10 @@ class Application_Model_Playlist { //using propel's phpNames. private $categories = array( - "dc:title" => "DbName", - "dc:creator" => "DbCreatorId", - "dc:description" => "DbDescription", - "dcterms:extent" => "DbLength" + "dc:title" => "Name", + "dc:creator" => "Creator", + "dc:description" => "Description", + "dcterms:extent" => "Length" ); @@ -115,6 +115,18 @@ class Application_Model_Playlist { return $this->pl->getDbDescription(); } + public function getCreator() { + + return $this->pl->getCcSubjs()->getDbLogin(); + } + + public function setCreator($p_id) { + + $this->pl->setDbCreatorId($p_id); + $this->pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC")); + $this->pl->save($this->con); + } + public function getLastModified($format = null) { return $this->pl->getDbMtime($format); } @@ -143,17 +155,13 @@ class Application_Model_Playlist { $offset = 0; foreach ($rows as $row) { $files[$i] = $row->toArray(BasePeer::TYPE_FIELDNAME, true, true); - // display only upto 1 decimal place by calling secondsToPlaylistTime + + $clipSec = Application_Model_Playlist::playlistTimeToSeconds($files[$i]['cliplength']); //$files[$i]['cliplength'] = Application_Model_Playlist::secondsToPlaylistTime($clipSec); $offset += $clipSec; $files[$i]['offset'] = Application_Model_Playlist::secondsToPlaylistTime($offset); - //Propel has been modified to only return SS.uuuuuu, might want this normalize - //feature to instead strip useless zeroes. - //$files[$i]['fadein'] = $this->normalizeFade($files[$i]['fadein']); - //$files[$i]['fadeout'] = $this->normalizeFade($files[$i]['fadeout']); - $i++; } @@ -184,7 +192,8 @@ class Application_Model_Playlist { //aggregate column on playlistcontents cliplength column. public function getLength() { - $this->pl->getDbLength(); + + return $this->pl->getDbLength(); } @@ -660,7 +669,7 @@ class Application_Model_Playlist { foreach($categories as $key => $val) { $method = 'get' . $val; - $md[$key] = $this->pl->$method(); + $md[$key] = $this->$method(); } return $md; @@ -670,7 +679,7 @@ class Application_Model_Playlist { { $cat = $this->categories[$category]; $method = 'get' . $cat; - return $this->pl->$method(); + return $this->$method(); } public function setPLMetaData($category, $value) @@ -678,16 +687,14 @@ class Application_Model_Playlist { $cat = $this->categories[$category]; $method = 'set' . $cat; - $this->pl->$method($value); - $this->pl->save($this->con); + $this->$method($value); } - /** - * Convert playlist time value to float seconds - * - * @param string $plt -- * playlist time value (HH:mm:ss.dddddd) +- * playlist interval value (HH:mm:ss.dddddd) - * @return int - * seconds - */ @@ -709,13 +716,11 @@ class Application_Model_Playlist { - * - * @param float $seconds - * @return string -- * time in playlist time format (HH:mm:ss.d) +- * interval in playlist time format (HH:mm:ss.d) - */ public static function secondsToPlaylistTime($p_seconds) { - $seconds = $p_seconds; - $rounded = round($seconds, 1); - $info = explode('.', $rounded); + $info = explode('.', $p_seconds); $seconds = $info[0]; if(!isset($info[1])){ $milliStr = 0; diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 91ea82347..fe21e7ee5 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -627,8 +627,8 @@ class Application_Model_StoredFile { $row['id'] = intval($row['id']); - $length = new DateTime($row['length']); - $row['length'] = self::formatDuration($length); + //$length = new DateTime($row['length']); + //$row['length'] = self::formatDuration($length); // add checkbox row $row['checkbox'] = ""; diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index 6d6ce0f58..7558c611b 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -15,7 +15,7 @@ class CcFiles extends BaseCcFiles { public function getDbLength($format = "H:i:s.u") { - return parent::getDbCliplength($format); + return parent::getDbLength($format); } public function setDbLength($v) diff --git a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js index fb8a0a526..33c6adc4b 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js @@ -2,7 +2,7 @@ var AIRTIME = (function(AIRTIME){ var mod; if (AIRTIME.library === undefined) { - AIRTIME.library = {} + AIRTIME.library = {}; } AIRTIME.library.events = {}; @@ -14,7 +14,7 @@ var AIRTIME = (function(AIRTIME){ $nRow.attr("id", aData["tr_id"]) .data("aData", aData) .data("screen", "playlist"); - } + }; mod.fnDrawCallback = function() { @@ -36,7 +36,7 @@ var AIRTIME = (function(AIRTIME){ cursor: 'pointer', connectToSortable: '#spl_sortable' }); - } + }; /* * @param oTable the datatables instance for the library. @@ -78,7 +78,7 @@ var AIRTIME = (function(AIRTIME){ ["Add", "library_group_add", true, fnAddSelectedItems]]; addToolBarButtonsLibrary(aButtons); - } + }; return AIRTIME; diff --git a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js index cf60989de..ffb1d2f9a 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js @@ -2,7 +2,7 @@ var AIRTIME = (function(AIRTIME){ var mod; if (AIRTIME.library === undefined) { - AIRTIME.library = {} + AIRTIME.library = {}; } AIRTIME.library.events = {}; @@ -14,7 +14,7 @@ var AIRTIME = (function(AIRTIME){ $nRow.attr("id", aData["tr_id"]) .data("aData", aData) .data("screen", "timeline"); - } + }; mod.fnDrawCallback = function() { @@ -23,7 +23,7 @@ var AIRTIME = (function(AIRTIME){ cursor: 'pointer', connectToSortable: '#show_builder_table' }); - } + }; mod.setupLibraryToolbar = function(oLibTable) { var aButtons, @@ -85,7 +85,7 @@ var AIRTIME = (function(AIRTIME){ ["Add", "library_group_add", true, fnAddSelectedItems]]; addToolBarButtonsLibrary(aButtons); - } + }; return AIRTIME; diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index 725883045..83de360a0 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -248,8 +248,10 @@ var AIRTIME = (function(AIRTIME){ } function redrawLib() { - var dt; - dt = $("#library_display").dataTable(); + var dt = $("#library_display").dataTable(), + oLibTT = TableTools.fnGetInstance('library_display'); + + oLibTT.fnSelectNone(); dt.fnStandingRedraw(); } @@ -525,7 +527,7 @@ var AIRTIME = (function(AIRTIME){ openPlaylist(json); redrawLib(); }); - } + }; mod.fnEdit = function(id) { var url; @@ -540,7 +542,7 @@ var AIRTIME = (function(AIRTIME){ openPlaylist(json); //redrawLib(); }); - } + }; mod.fnDelete = function(plid) { var url, id, lastMod; @@ -556,7 +558,7 @@ var AIRTIME = (function(AIRTIME){ openPlaylist(json); redrawLib(); }); - } + }; mod.fnAddItems = function(aItems, iAfter, sAddType) { @@ -599,7 +601,7 @@ var AIRTIME = (function(AIRTIME){ setFadeEvents(playlist); setUpPlaylist(playlist); - } + }; return AIRTIME;