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

This commit is contained in:
Rudi Grinberg 2012-08-21 14:24:35 -04:00
commit e539808586
3 changed files with 16 additions and 5 deletions

View File

@ -192,7 +192,7 @@ class Application_Model_Block
$files = array();
$sql = <<<"EOT"
SELECT pc.id as id, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, bl.type,
SELECT pc.id as id, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, bl.type, f.length as orig_length,
f.id as item_id, f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path FROM cc_blockcontents AS pc
LEFT JOIN cc_files AS f ON pc.file_id=f.id
LEFT JOIN cc_block AS bl ON pc.block_id = bl.id
@ -220,6 +220,10 @@ EOT;
$fades = $this->getFadeInfo($row['position']);
$row['fadein'] = $fades[0];
$row['fadeout'] = $fades[1];
//format original length
$formatter = new LengthFormatter($row['orig_length']);
$row['orig_length'] = $formatter->format();
}
return $rows;

View File

@ -171,7 +171,8 @@ class Application_Model_Playlist
f.track_title,
f.artist_name AS creator,
f.file_exists AS EXISTS,
f.filepath AS path
f.filepath AS path,
f.length AS orig_length
FROM cc_playlistcontents AS pc
JOIN cc_files AS f ON pc.file_id=f.id
WHERE pc.playlist_id = {$this->id}
@ -188,7 +189,8 @@ class Application_Model_Playlist
(ws.name || ': ' || ws.url) AS title,
sub.login AS creator,
't'::boolean AS EXISTS,
ws.url AS path
ws.url AS path,
ws.length AS orig_length
FROM cc_playlistcontents AS pc
JOIN cc_webstream AS ws ON pc.stream_id=ws.id
LEFT JOIN cc_subjs AS sub ON sub.id = ws.creator_id
@ -206,7 +208,8 @@ class Application_Model_Playlist
bl.name AS title,
sbj.login AS creator,
't'::boolean AS EXISTS,
NULL::text AS path
NULL::text AS path,
bl.length AS orig_length
FROM cc_playlistcontents AS pc
JOIN cc_block AS bl ON pc.block_id=bl.id
JOIN cc_subjs AS sbj ON bl.creator_id=sbj.id
@ -240,6 +243,10 @@ SQL;
$fades = $this->getFadeInfo($row['position']);
$row['fadein'] = $fades[0];
$row['fadeout'] = $fades[1];
//format original length
$formatter = new LengthFormatter($row['orig_length']);
$row['orig_length'] = $formatter->format();
}
return $rows;

View File

@ -55,7 +55,7 @@ if ($item['type'] == 2) {
'id' => $item["id"],
'cueIn' => $item['cuein'],
'cueOut' => $item['cueout'],
'origLength' => $item['length'])); ?>
'origLength' => $item['orig_length'])); ?>
</div>
<?php }?>