Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
3894990975
|
@ -511,7 +511,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
} elseif ($mode == "delete") {
|
} elseif ($mode == "delete") {
|
||||||
$filepath = $md['MDATA_KEY_FILEPATH'];
|
$filepath = $md['MDATA_KEY_FILEPATH'];
|
||||||
//$filepath = str_replace("\\", "", $filepath);
|
$filepath = str_replace("\\", "", $filepath);
|
||||||
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
|
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
|
||||||
|
|
||||||
if (is_null($file)) {
|
if (is_null($file)) {
|
||||||
|
|
|
@ -278,7 +278,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
||||||
|
|
||||||
$elementMap = array(
|
$elementMap = array(
|
||||||
'element_title' => isset($track['track_title']) ? $track['track_title'] : "",
|
'element_title' => isset($track['track_title']) ? $track['track_title'] : "",
|
||||||
'element_artist' => isset($track['artist_name']) ? $track['artist_name'] : "",
|
'element_artist' => isset($track['creator']) ? $track['creator'] : "",
|
||||||
'element_position' => $position,
|
'element_position' => $position,
|
||||||
'element_id' => ++$position,
|
'element_id' => ++$position,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1063,20 +1063,46 @@ SQL;
|
||||||
* In both cases (new and edit) we only grab shows that
|
* In both cases (new and edit) we only grab shows that
|
||||||
* are scheduled 2 days prior
|
* are scheduled 2 days prior
|
||||||
*/
|
*/
|
||||||
|
$se = $show_end->format('Y-m-d H:i:s');
|
||||||
if ($update) {
|
if ($update) {
|
||||||
$sql = "SELECT id, starts, ends FROM ".$CC_CONFIG["showInstances"]."
|
$sql = "SELECT id, starts, ends FROM ".$CC_CONFIG["showInstances"]."
|
||||||
where (ends <= '{$show_end->format('Y-m-d H:i:s')}'
|
where (ends <= '{$show_end->format('Y-m-d H:i:s')}'
|
||||||
or starts <= '{$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 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";
|
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 {
|
} else {
|
||||||
|
// TODO : Remove raw sql later
|
||||||
$sql = "SELECT id, starts, ends FROM ".$CC_CONFIG["showInstances"]."
|
$sql = "SELECT id, starts, ends FROM ".$CC_CONFIG["showInstances"]."
|
||||||
where (ends <= '{$show_end->format('Y-m-d H:i:s')}'
|
where (ends <= '{$show_end->format('Y-m-d H:i:s')}'
|
||||||
or starts <= '{$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 date(starts) >= (date('{$show_end->format('Y-m-d H:i:s')}') - INTERVAL '2 days')
|
||||||
and modified_instance = false order by ends";
|
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) {
|
foreach ($rows as $row) {
|
||||||
$start = new DateTime($row["starts"], new DateTimeZone('UTC'));
|
$start = new DateTime($row["starts"], new DateTimeZone('UTC'));
|
||||||
|
|
|
@ -1832,7 +1832,7 @@ SELECT si.starts AS start_timestamp,
|
||||||
s.url,
|
s.url,
|
||||||
starts,
|
starts,
|
||||||
ends
|
ends
|
||||||
FROM cc_show_instances si,
|
FROM cc_show_instances si
|
||||||
LEFT JOIN cc_show s
|
LEFT JOIN cc_show s
|
||||||
ON si.instance_id = s.id
|
ON si.instance_id = s.id
|
||||||
WHERE si.show_id = s.id
|
WHERE si.show_id = s.id
|
||||||
|
@ -1875,7 +1875,7 @@ SELECT si.starts AS start_timestamp,
|
||||||
s.url,
|
s.url,
|
||||||
starts,
|
starts,
|
||||||
ends
|
ends
|
||||||
FROM cc_show_instances si,
|
FROM cc_show_instances si
|
||||||
LEFT JOIN cc_show s
|
LEFT JOIN cc_show s
|
||||||
ON si.instance_id = s.id
|
ON si.instance_id = s.id
|
||||||
WHERE si.show_id = s.id
|
WHERE si.show_id = s.id
|
||||||
|
|
|
@ -655,6 +655,9 @@ FROM (
|
||||||
0::INTEGER as type ,
|
0::INTEGER as type ,
|
||||||
f.id AS item_id,
|
f.id AS item_id,
|
||||||
f.track_title,
|
f.track_title,
|
||||||
|
f.album_title AS album,
|
||||||
|
f.genre AS genre,
|
||||||
|
f.length AS length,
|
||||||
f.artist_name AS creator,
|
f.artist_name AS creator,
|
||||||
f.file_exists AS EXISTS,
|
f.file_exists AS EXISTS,
|
||||||
f.filepath AS filepath
|
f.filepath AS filepath
|
||||||
|
@ -668,6 +671,9 @@ FROM (
|
||||||
1::INTEGER as type,
|
1::INTEGER as type,
|
||||||
ws.id AS item_id,
|
ws.id AS item_id,
|
||||||
(ws.name || ': ' || ws.url) AS title,
|
(ws.name || ': ' || ws.url) AS title,
|
||||||
|
null AS album,
|
||||||
|
null AS genre,
|
||||||
|
ws.length AS length,
|
||||||
sub.login AS creator,
|
sub.login AS creator,
|
||||||
't'::boolean AS EXISTS,
|
't'::boolean AS EXISTS,
|
||||||
ws.url AS filepath
|
ws.url AS filepath
|
||||||
|
@ -688,8 +694,10 @@ SQL;
|
||||||
$dt->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
$dt->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||||
$row["starts"] = $dt->format("Y-m-d H:i:s");
|
$row["starts"] = $dt->format("Y-m-d H:i:s");
|
||||||
|
|
||||||
$formatter = new LengthFormatter($row["clip_length"]);
|
if (isset($row['length'])) {
|
||||||
$row["clip_length"] = $formatter->format();
|
$formatter = new LengthFormatter($row["length"]);
|
||||||
|
$row["length"] = $formatter->format();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
<?php $i=0; ?>
|
<?php $i=0; ?>
|
||||||
<?php foreach($this->showContent as $row): ?>
|
<?php foreach($this->showContent as $row): ?>
|
||||||
<tr id="au_<?php echo $row["file_id"] ?>" class="<?php if($i&1){echo "even";}else{echo "odd";}?>">
|
<tr id="au_<?php echo $row["item_id"] ?>" class="<?php if($i&1){echo "even";}else{echo "odd";}?>">
|
||||||
<td><?php echo $row["starts"] ?></td>
|
<td><?php echo $row["starts"] ?></td>
|
||||||
<td><?php echo $row["track_title"] ?></td>
|
<td><?php echo $row["track_title"] ?></td>
|
||||||
<td><?php echo $row["artist_name"] ?></td>
|
<td><?php echo $row["creator"] ?></td>
|
||||||
<td><?php echo $row["album_title"] ?></td>
|
<td><?php echo $row["album"] ?></td>
|
||||||
<td class="library_length"><?php echo $row["clip_length"] ?></td>
|
<td class="library_length"><?php echo $row["length"] ?></td>
|
||||||
<td><?php echo $row["genre"] ?></td>
|
<td><?php echo $row["genre"] ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $i=$i+1; ?>
|
<?php $i=$i+1; ?>
|
||||||
|
|
|
@ -27,7 +27,7 @@ set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_pat
|
||||||
set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path());
|
set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path());
|
||||||
|
|
||||||
//Zend framework
|
//Zend framework
|
||||||
if (file_exists('/usr/share/php/libzend-framework-php')){
|
if (file_exists('/usr/share/php/libzend-framework-php')) {
|
||||||
set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path());
|
set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,5 +39,14 @@ $application = new Zend_Application(
|
||||||
APPLICATION_ENV,
|
APPLICATION_ENV,
|
||||||
APPLICATION_PATH . '/configs/application.ini'
|
APPLICATION_PATH . '/configs/application.ini'
|
||||||
);
|
);
|
||||||
$application->bootstrap()
|
|
||||||
|
$sapi_type = php_sapi_name();
|
||||||
|
if (substr($sapi_type, 0, 3) == 'cli') {
|
||||||
|
set_include_path(APPLICATION_PATH . PATH_SEPARATOR . get_include_path());
|
||||||
|
require_once("Bootstrap.php");
|
||||||
|
} else {
|
||||||
|
$application->bootstrap()
|
||||||
->run();
|
->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
"mtime" : "n",
|
"mtime" : "n",
|
||||||
"lptime" : "n",
|
"lptime" : "n",
|
||||||
"disc_number" : "n",
|
"disc_number" : "n",
|
||||||
|
"encoded_by" : "s",
|
||||||
"genre" : "s",
|
"genre" : "s",
|
||||||
"isrc_number" : "s",
|
"isrc_number" : "s",
|
||||||
"label" : "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" } ,
|
/* 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" } ,
|
/* 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" } ,
|
/* 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" } ,
|
/* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" } ,
|
||||||
/* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "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" } ,
|
/* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" } ,
|
||||||
|
|
Loading…
Reference in New Issue