CC-3174 : showbuilder
testing newly returned times, fixing the secondsToPlaylistTime method to not drop subsecond precision for the calculations.
This commit is contained in:
parent
f651024a6e
commit
251f3a3e5b
6 changed files with 45 additions and 38 deletions
|
@ -38,10 +38,10 @@ class Application_Model_Playlist {
|
||||||
|
|
||||||
//using propel's phpNames.
|
//using propel's phpNames.
|
||||||
private $categories = array(
|
private $categories = array(
|
||||||
"dc:title" => "DbName",
|
"dc:title" => "Name",
|
||||||
"dc:creator" => "DbCreatorId",
|
"dc:creator" => "Creator",
|
||||||
"dc:description" => "DbDescription",
|
"dc:description" => "Description",
|
||||||
"dcterms:extent" => "DbLength"
|
"dcterms:extent" => "Length"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,6 +115,18 @@ class Application_Model_Playlist {
|
||||||
return $this->pl->getDbDescription();
|
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) {
|
public function getLastModified($format = null) {
|
||||||
return $this->pl->getDbMtime($format);
|
return $this->pl->getDbMtime($format);
|
||||||
}
|
}
|
||||||
|
@ -143,17 +155,13 @@ class Application_Model_Playlist {
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$files[$i] = $row->toArray(BasePeer::TYPE_FIELDNAME, true, true);
|
$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']);
|
$clipSec = Application_Model_Playlist::playlistTimeToSeconds($files[$i]['cliplength']);
|
||||||
//$files[$i]['cliplength'] = Application_Model_Playlist::secondsToPlaylistTime($clipSec);
|
//$files[$i]['cliplength'] = Application_Model_Playlist::secondsToPlaylistTime($clipSec);
|
||||||
$offset += $clipSec;
|
$offset += $clipSec;
|
||||||
$files[$i]['offset'] = Application_Model_Playlist::secondsToPlaylistTime($offset);
|
$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++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +192,8 @@ class Application_Model_Playlist {
|
||||||
|
|
||||||
//aggregate column on playlistcontents cliplength column.
|
//aggregate column on playlistcontents cliplength column.
|
||||||
public function getLength() {
|
public function getLength() {
|
||||||
$this->pl->getDbLength();
|
|
||||||
|
return $this->pl->getDbLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -660,7 +669,7 @@ class Application_Model_Playlist {
|
||||||
|
|
||||||
foreach($categories as $key => $val) {
|
foreach($categories as $key => $val) {
|
||||||
$method = 'get' . $val;
|
$method = 'get' . $val;
|
||||||
$md[$key] = $this->pl->$method();
|
$md[$key] = $this->$method();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $md;
|
return $md;
|
||||||
|
@ -670,7 +679,7 @@ class Application_Model_Playlist {
|
||||||
{
|
{
|
||||||
$cat = $this->categories[$category];
|
$cat = $this->categories[$category];
|
||||||
$method = 'get' . $cat;
|
$method = 'get' . $cat;
|
||||||
return $this->pl->$method();
|
return $this->$method();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPLMetaData($category, $value)
|
public function setPLMetaData($category, $value)
|
||||||
|
@ -678,16 +687,14 @@ class Application_Model_Playlist {
|
||||||
$cat = $this->categories[$category];
|
$cat = $this->categories[$category];
|
||||||
|
|
||||||
$method = 'set' . $cat;
|
$method = 'set' . $cat;
|
||||||
$this->pl->$method($value);
|
$this->$method($value);
|
||||||
$this->pl->save($this->con);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
- * Convert playlist time value to float seconds
|
- * Convert playlist time value to float seconds
|
||||||
- *
|
- *
|
||||||
- * @param string $plt
|
- * @param string $plt
|
||||||
- * playlist time value (HH:mm:ss.dddddd)
|
- * playlist interval value (HH:mm:ss.dddddd)
|
||||||
- * @return int
|
- * @return int
|
||||||
- * seconds
|
- * seconds
|
||||||
- */
|
- */
|
||||||
|
@ -709,13 +716,11 @@ class Application_Model_Playlist {
|
||||||
- *
|
- *
|
||||||
- * @param float $seconds
|
- * @param float $seconds
|
||||||
- * @return string
|
- * @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)
|
public static function secondsToPlaylistTime($p_seconds)
|
||||||
{
|
{
|
||||||
$seconds = $p_seconds;
|
$info = explode('.', $p_seconds);
|
||||||
$rounded = round($seconds, 1);
|
|
||||||
$info = explode('.', $rounded);
|
|
||||||
$seconds = $info[0];
|
$seconds = $info[0];
|
||||||
if(!isset($info[1])){
|
if(!isset($info[1])){
|
||||||
$milliStr = 0;
|
$milliStr = 0;
|
||||||
|
|
|
@ -627,8 +627,8 @@ class Application_Model_StoredFile {
|
||||||
|
|
||||||
$row['id'] = intval($row['id']);
|
$row['id'] = intval($row['id']);
|
||||||
|
|
||||||
$length = new DateTime($row['length']);
|
//$length = new DateTime($row['length']);
|
||||||
$row['length'] = self::formatDuration($length);
|
//$row['length'] = self::formatDuration($length);
|
||||||
|
|
||||||
// add checkbox row
|
// add checkbox row
|
||||||
$row['checkbox'] = "<input type='checkbox' name='cb_".$row['id']."'>";
|
$row['checkbox'] = "<input type='checkbox' name='cb_".$row['id']."'>";
|
||||||
|
|
|
@ -15,7 +15,7 @@ class CcFiles extends BaseCcFiles {
|
||||||
|
|
||||||
public function getDbLength($format = "H:i:s.u")
|
public function getDbLength($format = "H:i:s.u")
|
||||||
{
|
{
|
||||||
return parent::getDbCliplength($format);
|
return parent::getDbLength($format);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDbLength($v)
|
public function setDbLength($v)
|
||||||
|
|
|
@ -2,7 +2,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
var mod;
|
var mod;
|
||||||
|
|
||||||
if (AIRTIME.library === undefined) {
|
if (AIRTIME.library === undefined) {
|
||||||
AIRTIME.library = {}
|
AIRTIME.library = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
AIRTIME.library.events = {};
|
AIRTIME.library.events = {};
|
||||||
|
@ -14,7 +14,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$nRow.attr("id", aData["tr_id"])
|
$nRow.attr("id", aData["tr_id"])
|
||||||
.data("aData", aData)
|
.data("aData", aData)
|
||||||
.data("screen", "playlist");
|
.data("screen", "playlist");
|
||||||
}
|
};
|
||||||
|
|
||||||
mod.fnDrawCallback = function() {
|
mod.fnDrawCallback = function() {
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
connectToSortable: '#spl_sortable'
|
connectToSortable: '#spl_sortable'
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @param oTable the datatables instance for the library.
|
* @param oTable the datatables instance for the library.
|
||||||
|
@ -78,7 +78,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
["Add", "library_group_add", true, fnAddSelectedItems]];
|
["Add", "library_group_add", true, fnAddSelectedItems]];
|
||||||
|
|
||||||
addToolBarButtonsLibrary(aButtons);
|
addToolBarButtonsLibrary(aButtons);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
return AIRTIME;
|
return AIRTIME;
|
||||||
|
|
|
@ -2,7 +2,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
var mod;
|
var mod;
|
||||||
|
|
||||||
if (AIRTIME.library === undefined) {
|
if (AIRTIME.library === undefined) {
|
||||||
AIRTIME.library = {}
|
AIRTIME.library = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
AIRTIME.library.events = {};
|
AIRTIME.library.events = {};
|
||||||
|
@ -14,7 +14,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$nRow.attr("id", aData["tr_id"])
|
$nRow.attr("id", aData["tr_id"])
|
||||||
.data("aData", aData)
|
.data("aData", aData)
|
||||||
.data("screen", "timeline");
|
.data("screen", "timeline");
|
||||||
}
|
};
|
||||||
|
|
||||||
mod.fnDrawCallback = function() {
|
mod.fnDrawCallback = function() {
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
connectToSortable: '#show_builder_table'
|
connectToSortable: '#show_builder_table'
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
mod.setupLibraryToolbar = function(oLibTable) {
|
mod.setupLibraryToolbar = function(oLibTable) {
|
||||||
var aButtons,
|
var aButtons,
|
||||||
|
@ -85,7 +85,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
["Add", "library_group_add", true, fnAddSelectedItems]];
|
["Add", "library_group_add", true, fnAddSelectedItems]];
|
||||||
|
|
||||||
addToolBarButtonsLibrary(aButtons);
|
addToolBarButtonsLibrary(aButtons);
|
||||||
}
|
};
|
||||||
|
|
||||||
return AIRTIME;
|
return AIRTIME;
|
||||||
|
|
||||||
|
|
|
@ -248,8 +248,10 @@ var AIRTIME = (function(AIRTIME){
|
||||||
}
|
}
|
||||||
|
|
||||||
function redrawLib() {
|
function redrawLib() {
|
||||||
var dt;
|
var dt = $("#library_display").dataTable(),
|
||||||
dt = $("#library_display").dataTable();
|
oLibTT = TableTools.fnGetInstance('library_display');
|
||||||
|
|
||||||
|
oLibTT.fnSelectNone();
|
||||||
dt.fnStandingRedraw();
|
dt.fnStandingRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,7 +527,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
openPlaylist(json);
|
openPlaylist(json);
|
||||||
redrawLib();
|
redrawLib();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
mod.fnEdit = function(id) {
|
mod.fnEdit = function(id) {
|
||||||
var url;
|
var url;
|
||||||
|
@ -540,7 +542,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
openPlaylist(json);
|
openPlaylist(json);
|
||||||
//redrawLib();
|
//redrawLib();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
mod.fnDelete = function(plid) {
|
mod.fnDelete = function(plid) {
|
||||||
var url, id, lastMod;
|
var url, id, lastMod;
|
||||||
|
@ -556,7 +558,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
openPlaylist(json);
|
openPlaylist(json);
|
||||||
redrawLib();
|
redrawLib();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
mod.fnAddItems = function(aItems, iAfter, sAddType) {
|
mod.fnAddItems = function(aItems, iAfter, sAddType) {
|
||||||
|
|
||||||
|
@ -599,7 +601,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
setFadeEvents(playlist);
|
setFadeEvents(playlist);
|
||||||
|
|
||||||
setUpPlaylist(playlist);
|
setUpPlaylist(playlist);
|
||||||
}
|
};
|
||||||
|
|
||||||
return AIRTIME;
|
return AIRTIME;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue