CC-4668: Blocks/Playlists: Length includes deleted tracks
-saving block length was including files that do not exist
This commit is contained in:
parent
ddb6289c87
commit
3b124e6f5d
1 changed files with 3 additions and 1 deletions
|
@ -360,8 +360,10 @@ SQL;
|
||||||
{
|
{
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
SELECT SUM(cliplength) AS LENGTH
|
SELECT SUM(cliplength) AS LENGTH
|
||||||
FROM cc_blockcontents
|
FROM cc_blockcontents as bc
|
||||||
|
JOIN cc_files as f ON bc.file_id = f.id
|
||||||
WHERE block_id = :block_id
|
WHERE block_id = :block_id
|
||||||
|
AND f.file_exists = true
|
||||||
SQL;
|
SQL;
|
||||||
$result = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id), 'all', PDO::FETCH_NUM);
|
$result = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id), 'all', PDO::FETCH_NUM);
|
||||||
return $result[0][0];
|
return $result[0][0];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue