CC-84: Smart Playlists

- Length calculation for dynamic blocks and playlist that contains
dynamic blocks
This commit is contained in:
James 2012-07-31 17:46:37 -04:00
parent 1b0cd6b01b
commit 9d51222dae
6 changed files with 78 additions and 10 deletions

View file

@ -87,6 +87,14 @@ class Application_Model_Datatables
$r = $con->query($sql);
$r->setFetchMode(PDO::FETCH_ASSOC);
$results = $r->fetchAll();
// we need to go over all items and fix length for playlist
// in case the playlist contains dynamic block
foreach ($results as &$r) {
if ($r['ftype'] == 'playlist') {
$pl = new Application_Model_Playlist($r['id']);
$r['length'] = $pl->getLength();
}
}
} catch (Exception $e) {
Logging::debug($e->getMessage());
}