Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
c1bc50c1db
|
@ -19,6 +19,7 @@ require_once __DIR__."/configs/constants.php";
|
|||
require_once 'Preference.php';
|
||||
require_once "DateHelper.php";
|
||||
require_once "OsPath.php";
|
||||
require_once "Database.php";
|
||||
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
class Application_Common_Database{
|
||||
public static function prepareAndExcute($sql, $paramValueMap, $type='all'){
|
||||
$con = Propel::getConnection();
|
||||
$stmt = $con->prepare($sql);
|
||||
foreach ($paramValueMap as $param => $v) {
|
||||
$stmt->bindValue($param, $v);
|
||||
}
|
||||
$rows = array();
|
||||
if ($stmt->execute()) {
|
||||
if ($type == 'single') {
|
||||
$rows = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
} else if ($type == 'column'){
|
||||
$rows = $stmt->fetchColumn();
|
||||
} else {
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
} else {
|
||||
$msg = implode(',', $stmt->errorInfo());
|
||||
throw new Exception("Error: $msg");
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
}
|
|
@ -278,7 +278,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
$elementMap = array(
|
||||
'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_id' => ++$position,
|
||||
);
|
||||
|
|
|
@ -1832,7 +1832,7 @@ SELECT si.starts AS start_timestamp,
|
|||
s.url,
|
||||
starts,
|
||||
ends
|
||||
FROM cc_show_instances si,
|
||||
FROM cc_show_instances si
|
||||
LEFT JOIN cc_show s
|
||||
ON si.instance_id = s.id
|
||||
WHERE si.show_id = s.id
|
||||
|
@ -1875,7 +1875,7 @@ SELECT si.starts AS start_timestamp,
|
|||
s.url,
|
||||
starts,
|
||||
ends
|
||||
FROM cc_show_instances si,
|
||||
FROM cc_show_instances si
|
||||
LEFT JOIN cc_show s
|
||||
ON si.instance_id = s.id
|
||||
WHERE si.show_id = s.id
|
||||
|
|
|
@ -655,6 +655,9 @@ FROM (
|
|||
0::INTEGER as type ,
|
||||
f.id AS item_id,
|
||||
f.track_title,
|
||||
f.album_title AS album,
|
||||
f.genre AS genre,
|
||||
f.length AS length,
|
||||
f.artist_name AS creator,
|
||||
f.file_exists AS EXISTS,
|
||||
f.filepath AS filepath
|
||||
|
@ -668,6 +671,9 @@ FROM (
|
|||
1::INTEGER as type,
|
||||
ws.id AS item_id,
|
||||
(ws.name || ': ' || ws.url) AS title,
|
||||
null AS album,
|
||||
null AS genre,
|
||||
ws.length AS length,
|
||||
sub.login AS creator,
|
||||
't'::boolean AS EXISTS,
|
||||
ws.url AS filepath
|
||||
|
@ -688,8 +694,10 @@ SQL;
|
|||
$dt->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||
$row["starts"] = $dt->format("Y-m-d H:i:s");
|
||||
|
||||
$formatter = new LengthFormatter($row["clip_length"]);
|
||||
$row["clip_length"] = $formatter->format();
|
||||
if (isset($row['length'])) {
|
||||
$formatter = new LengthFormatter($row["length"]);
|
||||
$row["length"] = $formatter->format();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
</tr>
|
||||
<?php $i=0; ?>
|
||||
<?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["track_title"] ?></td>
|
||||
<td><?php echo $row["artist_name"] ?></td>
|
||||
<td><?php echo $row["album_title"] ?></td>
|
||||
<td class="library_length"><?php echo $row["clip_length"] ?></td>
|
||||
<td><?php echo $row["creator"] ?></td>
|
||||
<td><?php echo $row["album"] ?></td>
|
||||
<td class="library_length"><?php echo $row["length"] ?></td>
|
||||
<td><?php echo $row["genre"] ?></td>
|
||||
</tr>
|
||||
<?php $i=$i+1; ?>
|
||||
|
|
|
@ -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" } ,
|
||||
|
|
Loading…
Reference in New Issue