Merge branch 'master' of dev.sourcefabric.org:campcaster

This commit is contained in:
mkonecny 2011-02-04 18:22:51 -05:00
commit 27293c6b8f
12 changed files with 153 additions and 44 deletions

View file

@ -35,6 +35,7 @@
<actionMethod actionName="delete"/> <actionMethod actionName="delete"/>
<actionMethod actionName="contents"/> <actionMethod actionName="contents"/>
<actionMethod actionName="editFileMd"/> <actionMethod actionName="editFileMd"/>
<actionMethod actionName="getFileMetaData"/>
</controllerFile> </controllerFile>
<controllerFile controllerName="Plupload"> <controllerFile controllerName="Plupload">
<actionMethod actionName="index"/> <actionMethod actionName="index"/>
@ -283,6 +284,9 @@
<viewControllerScriptsDirectory forControllerName="Preference"> <viewControllerScriptsDirectory forControllerName="Preference">
<viewScriptFile forActionName="update"/> <viewScriptFile forActionName="update"/>
</viewControllerScriptsDirectory> </viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Library">
<viewScriptFile forActionName="getFileMetaData"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory> </viewScriptsDirectory>
<viewHelpersDirectory/> <viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/> <viewFiltersDirectory enabled="false"/>

View file

@ -60,8 +60,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile('/js/libs/jquery.stickyPanel.js','text/javascript'); $view->headScript()->appendFile('/js/libs/jquery.stickyPanel.js','text/javascript');
//scripts for now playing bar //scripts for now playing bar
$this->view->headScript()->appendFile('/js/playlist/helperfunctions.js','text/javascript'); //$this->view->headScript()->appendFile('/js/playlist/helperfunctions.js','text/javascript');
$this->view->headScript()->appendFile('/js/playlist/playlist.js','text/javascript'); //$this->view->headScript()->appendFile('/js/playlist/playlist.js','text/javascript');
$view->headScript()->appendFile('/js/airtime/common/common.js','text/javascript'); $view->headScript()->appendFile('/js/airtime/common/common.js','text/javascript');
} }

View file

@ -16,6 +16,7 @@ class LibraryController extends Zend_Controller_Action
$ajaxContext->addActionContext('contents', 'json') $ajaxContext->addActionContext('contents', 'json')
->addActionContext('delete', 'json') ->addActionContext('delete', 'json')
->addActionContext('context-menu', 'json') ->addActionContext('context-menu', 'json')
->addActionContext('get-file-meta-data', 'html')
->initContext(); ->initContext();
$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME); $this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
@ -24,9 +25,10 @@ class LibraryController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
$this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript'); $this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript');
$this->view->headScript()->appendFile('/js/jplayer/jquery.jplayer.min.js'); $this->view->headScript()->appendFile('/js/jplayer/jquery.jplayer.min.js');
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript'); $this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript');
$this->view->headScript()->appendFile('/js/qtip/jquery.qtip-1.0.0.min.js','text/javascript');
$this->view->headScript()->appendFile('/js/airtime/library/library.js','text/javascript'); $this->view->headScript()->appendFile('/js/airtime/library/library.js','text/javascript');
$this->view->headLink()->appendStylesheet('/css/media_library.css'); $this->view->headLink()->appendStylesheet('/css/media_library.css');
@ -90,7 +92,7 @@ class LibraryController extends Zend_Controller_Action
public function deleteAction() public function deleteAction()
{ {
$id = $this->_getParam('id'); $id = $this->_getParam('id');
if (!is_null($id)) { if (!is_null($id)) {
$file = StoredFile::Recall($id); $file = StoredFile::Recall($id);
@ -116,7 +118,7 @@ class LibraryController extends Zend_Controller_Action
public function contentsAction() public function contentsAction()
{ {
$post = $this->getRequest()->getPost(); $post = $this->getRequest()->getPost();
$datatables = StoredFile::searchFilesForPlaylistBuilder($post); $datatables = StoredFile::searchFilesForPlaylistBuilder($post);
die(json_encode($datatables)); die(json_encode($datatables));
@ -144,6 +146,27 @@ class LibraryController extends Zend_Controller_Action
$this->view->form = $form; $this->view->form = $form;
} }
public function getFileMetaDataAction()
{
$id = $this->_getParam('id');
$type = $this->_getParam('type');
if($type == "au") {
$file = StoredFile::Recall($id);
$this->view->type = $type;
$this->view->md = $file->md;
}
else if($type == "pl") {
$file = Playlist::Recall($id);
$this->view->type = $type;
$this->view->md = $file->getAllPLMetaData();
$this->view->contents = $file->getContents();
}
}
} }
@ -162,3 +185,5 @@ class LibraryController extends Zend_Controller_Action

View file

@ -166,13 +166,13 @@ class Playlist {
return FALSE; return FALSE;
$storedPlaylist = new Playlist(); $storedPlaylist = new Playlist();
$storedPlaylist->id = $pl->getDbId(); $storedPlaylist->id = $id;
$storedPlaylist->name = $pl->getDbName(); $storedPlaylist->name = $pl->getDbName();
$storedPlaylist->state = $pl->getDbState(); $storedPlaylist->state = $pl->getDbState();
$storedPlaylist->currentlyaccessing = $pl->getDbCurrentlyaccessing(); $storedPlaylist->currentlyaccessing = $pl->getDbCurrentlyaccessing();
$storedPlaylist->editedby = $pl->getDbEditedby(); $storedPlaylist->editedby = $pl->getDbEditedby();
$storedPlaylist->mtime = $pl->getDbMtime(); $storedPlaylist->mtime = $pl->getDbMtime();
return $storedPlaylist; return $storedPlaylist;
} }
@ -461,7 +461,7 @@ class Playlist {
} }
$metadata = $media->getMetadata(); $metadata = $media->getMetadata();
$length = $metadata["length"]; $length = $metadata["dcterms:extent"];
if (!is_null($p_clipLength)) { if (!is_null($p_clipLength)) {
$length = $p_clipLength; $length = $p_clipLength;
@ -777,6 +777,25 @@ class Playlist {
} }
public function getAllPLMetaData()
{
$categories = $this->categories;
$row = CcPlaylistQuery::create()->findPK($this->id);
$md = array();
foreach($categories as $key => $val) {
if($val === 'length') {
$md[$key] = $this->getLength();
continue;
}
$method = 'get' . $val;
$md[$key] = $row->$method();
}
return $md;
}
public function getPLMetaData($category) public function getPLMetaData($category)
{ {
$cat = $this->categories[$category]; $cat = $this->categories[$category];

View file

@ -492,9 +492,9 @@ class StoredFile {
$escapedValue = pg_escape_string($this->gunid); $escapedValue = pg_escape_string($this->gunid);
$sql = "SELECT * FROM ".$CC_CONFIG["filesTable"] $sql = "SELECT * FROM ".$CC_CONFIG["filesTable"]
." WHERE gunid='$escapedValue'"; ." WHERE gunid='$escapedValue'";
//var_dump($sql);
$this->md = $CC_DBC->getRow($sql); $this->md = $CC_DBC->getRow($sql);
//var_dump($this->md);
if (PEAR::isError($this->md)) { if (PEAR::isError($this->md)) {
$error = $this->md; $error = $this->md;
$this->md = null; $this->md = null;
@ -511,10 +511,9 @@ class StoredFile {
$compatibilityData[$xmlName] = $value; $compatibilityData[$xmlName] = $value;
} }
} }
//var_dump($compatibilityData);
$this->md = array_merge($this->md, $compatibilityData); //$this->md = array_merge($this->md, $compatibilityData);
//var_dump($this->md); $this->md = $compatibilityData;
//$_SESSION["debug"] = $this->md;
} }
public function setFormat($p_value) public function setFormat($p_value)
@ -707,7 +706,7 @@ class StoredFile {
$sql = "SELECT *" $sql = "SELECT *"
." FROM ".$CC_CONFIG['filesTable'] ." FROM ".$CC_CONFIG['filesTable']
." WHERE $cond"; ." WHERE $cond";
//echo $sql;
$row = $CC_DBC->getRow($sql); $row = $CC_DBC->getRow($sql);
if (PEAR::isError($row) || is_null($row)) { if (PEAR::isError($row) || is_null($row)) {
return $row; return $row;

View file

@ -1 +0,0 @@
<?php echo $this->partialLoop('library/libraryTablePartial.phtml', $this->files) ?>

View file

@ -1 +0,0 @@
<li><a href="<?php echo $this->action ?>"><?php echo $this->text ?></a></li>

View file

@ -0,0 +1,47 @@
<?php if($this->type == "au") : ?>
<div><span>Title:</span><span><?php echo ($this->md["dc:title"]);?></span></div>
<div><span>Artist:</span><span><?php echo ($this->md["dc:creator"]);?></span></div>
<div><span>Album:</span><span><?php echo ($this->md["dc:source"]);?></span></div>
<div><span>Track:</span><span><?php echo ($this->md["ls:track_num"]);?></span></div>
<div><span>Length:</span><span><?php echo ($this->md["dcterms:extent"]);?></span></div>
<div><span>Genre:</span><span><?php echo ($this->md["dc:type"]);?></span></div>
<div><span>Sample Rate:</span><span><?php echo ($this->md["ls:samplerate"]);?></span></div>
<div><span>Bit Rate:</span><span><?php echo ($this->md["ls:bitrate"]);?></span></div>
<div><span>Channels:</span><span><?php echo ($this->md["ls:channels"]);?></span></div>
<div><span>Year:</span><span><?php echo ($this->md["ls:year"]);?></span></div>
<div><span>Label:</span><span><?php echo ($this->md["dc:publisher"]);?></span></div>
<div><span>BPM:</span><span><?php echo ($this->md["ls:bpm"]);?></span></div>
<div><span>Channels:</span><span><?php echo ($this->md["ls:channels"]);?></span></div>
<div><span>Orchestra:</span><span><?php echo ($this->md["ls:orchestra"]);?></span></div>
<div><span>Conductor:</span><span><?php echo ($this->md["ls:conductor"]);?></span></div>
<div><span>Copyright:</span><span><?php echo ($this->md["dc:rights"]);?></span></div>
<div><span>Catalog Number:</span><span><?php echo ($this->md["ls:catalognumber"]);?></span></div>
<div><span>Isrc Number:</span><span><?php echo ($this->md["ls:isrcnumber"]);?></span></div>
<div><span>Report Datetime:</span><span><?php echo ($this->md["dcterms:temporal"]);?></span></div>
<div><span>Report Location:</span><span><?php echo ($this->md["dcterms:spatial"]);?></span></div>
<div><span>Report Organization:</span><span><?php echo ($this->md["dcterms:entity"]);?></span></div>
<div><span>Subject:</span><span><?php echo ($this->md["dc:subject"]);?></span></div>
<div><span>Contributor:</span><span><?php echo ($this->md["dc:contributor"]);?></span></div>
<div><span>Language:</span><span><?php echo ($this->md["dc:language"]);?></span></div>
<div><span>Comments:</span><span><?php echo ($this->md["dc:description"]);?></span></div>
<?php endif; ?>
<?php if($this->type == "pl") : ?>
<div><span>Name:</span><span><?php echo ($this->md["dc:title"]);?></span></div>
<div><span>Creator:</span><span><?php echo ($this->md["dc:creator"]);?></span></div>
<div><span>Length:</span><span><?php echo ($this->md["dcterms:extent"]);?></span></div>
<div><span>Description:</span><span><?php echo ($this->md["dc:description"]);?></span></div>
<div><span>Contents: </span>
<?php foreach($this->contents as $row) : ?>
<div>
<span><?php echo $row["CcFiles"]["track_title"] ?></span>
<span><?php echo $row["CcFiles"]["artist_name"] ?></span>
<span><?php echo $row["CcFiles"]["album_title"] ?></span>
<span><?php echo $row["cliplength"] ?></span>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>

View file

@ -1,2 +0,0 @@
<label for="quick_search">Search:</label>
<input id="quick_search" name="quick_search" type="text" value = "<?php echo $this->qs_value ?>"></input>

View file

@ -702,7 +702,7 @@ dt.block-display, dd.block-display {
.floated-panel { .floated-panel {
margin-top:0; margin-top:0;
width:99.99%; width:99.99%;
z-index:9999; z-index:999;
} }

View file

@ -60,9 +60,47 @@ function addLibraryItemEvents() {
} }
function dtRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { function dtRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var id = aData[6].substring(0,2) + "_" + aData[0]; var id, type, once;
$(nRow).attr("id", id); type = aData[6].substring(0,2);
id = aData[0];
$(nRow).attr("id", type+'_'+id);
$(nRow).qtip({
content: {
url: '/Library/get-file-meta-data',
type: 'post',
data: ({format: "html", id : id, type: type}),
title: {
text: aData[1] + ' MetaData',
button: 'Close' // Show a close link in the title
}
},
position: {
corner: {
//target: 'leftMiddle'
tooltip: 'rightMiddle'
},
adjust: {
screen: true // Keep the tooltip on-screen at all times
}
},
show: {
when: 'click',
solo: true // Only show one tooltip at a time
},
hide: 'click',
style: {
border: {
width: 0,
radius: 4
},
name: 'dark', // Use the default light style
width: 570 // Set the tooltip width
}
});
return nRow; return nRow;
} }

View file

@ -45,14 +45,14 @@ function setScheduleDialogEvents(dialog) {
} }
}); });
dialog.find(".ui-icon-close").parent().click(function(){ dialog.find(".ui-icon-close").click(function(){
var groupId, url; var groupId, url;
groupId = $(this).parent().parent().attr("id").split("_").pop(); groupId = $(this).parent().parent().attr("id").split("_").pop();
url = '/Schedule/remove-group/format/json'; url = '/Schedule/remove-group';
$.post(url, $.post(url,
{groupId: groupId}, {format: "json", groupId: groupId},
function(json){ function(json){
var dialog = $("#schedule_playlist_dialog"); var dialog = $("#schedule_playlist_dialog");
@ -83,25 +83,6 @@ function dtDrawCallback() {
} }
function makeScheduleDialog(dialog, json) { function makeScheduleDialog(dialog, json) {
dialog.find("#schedule_playlist_search").keyup(function(){
var url, string;
url = "/Schedule/find-playlists/format/html";
string = $(this).val();
$.post(url, {search: string}, function(html){
$("#schedule_playlist_choice")
.empty()
.append(html)
.find('li')
.draggable({
helper: 'clone'
});
});
});
dialog.find('#schedule_playlists').dataTable( { dialog.find('#schedule_playlists').dataTable( {
"bProcessing": true, "bProcessing": true,