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

This commit is contained in:
Martin Konecny 2012-09-05 17:29:55 -04:00
commit dad1cf32c9
3 changed files with 30 additions and 3 deletions

View File

@ -511,7 +511,7 @@ class ApiController extends Zend_Controller_Action
}
} elseif ($mode == "delete") {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
$filepath = str_replace("\\", "", $filepath);
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
if (is_null($file)) {

View File

@ -1063,20 +1063,46 @@ SQL;
* In both cases (new and edit) we only grab shows that
* are scheduled 2 days prior
*/
$se = $show_end->format('Y-m-d H:i:s');
if ($update) {
$sql = "SELECT id, starts, ends FROM ".$CC_CONFIG["showInstances"]."
where (ends <= '{$show_end->format('Y-m-d H:i:s')}'
or starts <= '{$show_end->format('Y-m-d H:i:s')}')
and date(starts) >= (date('{$show_end->format('Y-m-d H:i:s')}') - INTERVAL '2 days')
and modified_instance = false and id != ".$instanceId. " order by ends";
$stmt = $con->prepare("SELECT id, starts, ends FROM :showInstances
where (ends <= :show_end1
or starts <= :show_end2)
and date(starts) >= (date(:show_end3) - INTERVAL '2 days')
and modified_instance = false and id != :instanceId order by ends");
$stmt->execute(array(
':showInstances' => $CC_CONFIG['showInstances'],
':show_end1' => $se,
':show_end2' => $se,
':show_end3' => $se,
':instanceId' => $instanceId
));
} else {
// TODO : Remove raw sql later
$sql = "SELECT id, starts, ends FROM ".$CC_CONFIG["showInstances"]."
where (ends <= '{$show_end->format('Y-m-d H:i:s')}'
or starts <= '{$show_end->format('Y-m-d H:i:s')}')
and date(starts) >= (date('{$show_end->format('Y-m-d H:i:s')}') - INTERVAL '2 days')
and modified_instance = false order by ends";
$stmt = $con->prepare("SELECT id, starts, ends FROM :showInstances
where (ends <= :show_end1
or starts <= :show_end2)
and date(starts) >= (date(:show_end3) - INTERVAL '2 days')
and modified_instance = false order by ends");
$stmt->execute(array(
':showInstances' => $CC_CONFIG['showInstances'],
':show_end1' => $se,
':show_end2' => $se,
':show_end3' => $se,
));
}
$rows = $con->query($sql);
//$rows = $con->query($sql);
$rows->fetchAll();
foreach ($rows as $row) {
$start = new DateTime($row["starts"], new DateTimeZone('UTC'));

View File

@ -21,6 +21,7 @@ var AIRTIME = (function(AIRTIME) {
"mtime" : "n",
"lptime" : "n",
"disc_number" : "n",
"encoded_by" : "s",
"genre" : "s",
"isrc_number" : "s",
"label" : "s",
@ -406,7 +407,7 @@ var AIRTIME = (function(AIRTIME) {
/* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" } ,
/* Sample Rate */ { "sTitle" : "Sample" , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" } ,
/* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" } ,
/* Encoded */ { "sTitle" : "Encoded" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" } ,
/* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" } ,
/* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" } ,
/* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" } ,
/* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" } ,