Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-08-13 14:58:20 -04:00
commit c3862d69e5
7 changed files with 73 additions and 40 deletions

View File

@ -270,7 +270,7 @@ class LibraryController extends Zend_Controller_Action
Logging::log($data['MDATA_KEY_FILEPATH']); Logging::log($data['MDATA_KEY_FILEPATH']);
Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data); Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data);
$this->_redirect('playlist/index'); $this->_redirect('Playlist');
} }
} }

View File

@ -42,7 +42,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
"album_title" => "s", "album_title" => "s",
"artist_name" => "s", "artist_name" => "s",
"bit_rate" => "n", "bit_rate" => "n",
"bpm" => "n", "bpm" => "s",
"comments" => "s", "comments" => "s",
"composer" => "s", "composer" => "s",
"conductor" => "s", "conductor" => "s",

View File

@ -275,12 +275,24 @@ EOT;
if ($modifier == "items") { if ($modifier == "items") {
$length = $value." ".$modifier; $length = $value." ".$modifier;
} else { } else {
$value = str_pad($value, 2, "0", STR_PAD_LEFT); $hour = "00";
if ($modifier == "minutes") { if ($modifier == "minutes") {
$length = "00:".$value.":00"; if ($value >59) {
$hour = intval($value/60);
$value = $value%60;
}
} else if ($modifier == "hours") { } else if ($modifier == "hours") {
$length = $value.":00:00"; $mins = $value * 60;
if ($mins >59) {
$hour = intval($mins/60);
$hour = str_pad($hour, 2, "0", STR_PAD_LEFT);
$value = $mins%60;
}
} }
$hour = str_pad($hour, 2, "0", STR_PAD_LEFT);
$value = str_pad($value, 2, "0", STR_PAD_LEFT);
$length = $hour.":".$value.":00";
} }
return $length; return $length;
} }
@ -1301,9 +1313,20 @@ EOT;
foreach ($crit as $criteria) { foreach ($crit as $criteria) {
$spCriteriaPhpName = self::$criteria2PeerMap[$criteria['criteria']]; $spCriteriaPhpName = self::$criteria2PeerMap[$criteria['criteria']];
$spCriteria = $criteria['criteria']; $spCriteria = $criteria['criteria'];
$spCriteriaModifier = $criteria['modifier']; $spCriteriaModifier = $criteria['modifier'];
$spCriteriaValue = $criteria['value'];
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$spCriteria]);
// if the column is timestamp, convert it into UTC
if ($column->getType() == PropelColumnTypes::TIMESTAMP) {
$spCriteriaValue = Application_Common_DateHelper::ConvertToUtcDateTimeString($criteria['value']);
} else if($spCriteria == "bit_rate") {
// multiply 1000 because we store only number value
// e.g 192kps is stored as 192000
$spCriteriaValue = $criteria['value']*1000;
} else {
$spCriteriaValue = $criteria['value'];
}
if ($spCriteriaModifier == "starts with") { if ($spCriteriaModifier == "starts with") {
$spCriteriaValue = "$spCriteriaValue%"; $spCriteriaValue = "$spCriteriaValue%";
} else if ($spCriteriaModifier == "ends with") { } else if ($spCriteriaModifier == "ends with") {

View File

@ -38,7 +38,7 @@ if (isset($this->obj)) {
<?php //echo $this->form; ?> <?php //echo $this->form; ?>
<div id="crossfade_main" class="crossfade-main clearfix" style="display:none;"> <div id="crossfade_main" class="crossfade-main clearfix" style="display:none;">
<span class="ui-icon ui-icon-closethick"></span> <span class="ui-icon ui-icon-closethick sp-closethick-center"></span>
<dl id="spl_editor-main" class="inline-list"> <dl id="spl_editor-main" class="inline-list">
<dt>Fade in (s):</dt> <dt>Fade in (s):</dt>
<dd><span contenteditable="true" class="spl_text_input spl_main_fade_in">00</span></dd> <dd><span contenteditable="true" class="spl_text_input spl_main_fade_in">00</span></dd>

View File

@ -67,6 +67,10 @@
margin-top: 7px; margin-top: 7px;
} }
.sp-closethick-center {
margin-top: auto !important;
}
.spl_title { .spl_title {
font-size:14px; font-size:14px;
} }

View File

@ -61,18 +61,15 @@ var AIRTIME = (function(AIRTIME){
.hide(); .hide();
} }
function changeCueIn(event) { function changeCueIn(span) {
event.stopPropagation(); var id = span.parent().attr("id").split("_").pop(),
url = "/Playlist/set-cue",
var span = $(this), cueIn = $.trim(span.text()),
id = span.parent().attr("id").split("_").pop(), li = span.parents("li"),
url = "/Playlist/set-cue", unqid = li.attr("unqid"),
cueIn = $.trim(span.text()), lastMod = getModified(),
li = span.parents("li"), type = $('#obj_type').val();
unqid = li.attr("unqid"),
lastMod = getModified(),
type = $('#obj_type').val();
if (!isTimeValid(cueIn)){ if (!isTimeValid(cueIn)){
showError(span, "please put in a time '00:00:00 (.000000)'"); showError(span, "please put in a time '00:00:00 (.000000)'");
return; return;
@ -100,16 +97,13 @@ var AIRTIME = (function(AIRTIME){
}); });
} }
function changeCueOut(event) { function changeCueOut(span) {
event.stopPropagation(); var id = span.parent().attr("id").split("_").pop(),
url = "/Playlist/set-cue",
var span = $(this), cueOut = $.trim(span.text()),
id = span.parent().attr("id").split("_").pop(), li = span.parents("li"),
url = "/Playlist/set-cue", unqid = li.attr("unqid"),
cueOut = $.trim(span.text()), lastMod = getModified(),
li = span.parents("li"),
unqid = li.attr("unqid"),
lastMod = getModified(),
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isTimeValid(cueOut)){ if (!isTimeValid(cueOut)){
@ -140,7 +134,7 @@ var AIRTIME = (function(AIRTIME){
} }
function changeFadeIn(event) { function changeFadeIn(event) {
event.stopPropagation(); event.preventDefault();
var span = $(this), var span = $(this),
id = span.parent().attr("id").split("_").pop(), id = span.parent().attr("id").split("_").pop(),
@ -406,14 +400,26 @@ var AIRTIME = (function(AIRTIME){
//sets events dynamically for the cue editor. //sets events dynamically for the cue editor.
function setCueEvents() { function setCueEvents() {
$pl.delegate(".spl_cue_in span", $('.spl_cue_in span').blur(function(e){
{"focusout": changeCueIn, e.stopPropagation();
"keydown": submitOnEnter}); changeCueIn($(this));
});
$pl.delegate(".spl_cue_out span",
{"focusout": changeCueOut, $('.spl_cue_in span').keydown(function(e){
"keydown": submitOnEnter}); e.stopPropagation();
submitOnEnter(e);
});
$('.spl_cue_out span').blur(function(e){
e.stopPropagation();
changeCueOut($(this));
});
$('.spl_cue_out span').keydown(function(e){
e.stopPropagation();
submitOnEnter(e);
});
} }
//sets events dynamically for the fade editor. //sets events dynamically for the fade editor.

View File

@ -568,7 +568,7 @@ var criteriaTypes = {
"album_title" : "s", "album_title" : "s",
"artist_name" : "s", "artist_name" : "s",
"bit_rate" : "n", "bit_rate" : "n",
"bpm" : "n", "bpm" : "s",
"comments" : "s", "comments" : "s",
"composer" : "s", "composer" : "s",
"conductor" : "s", "conductor" : "s",