Fix recounting not working on non-album tags.

This commit is contained in:
Aaron van Geffen 2019-09-29 14:20:43 +02:00
parent 5df7ea8371
commit d7b68995e8

View File

@ -492,7 +492,7 @@ class Asset
'id_asset' => $this->id_asset, 'id_asset' => $this->id_asset,
]); ]);
$rows = $db->query(' $recount_tags = $db->queryValues('
SELECT id_tag SELECT id_tag
FROM assets_tags FROM assets_tags
WHERE id_asset = {int:id_asset}', WHERE id_asset = {int:id_asset}',
@ -500,11 +500,6 @@ class Asset
'id_asset' => $this->id_asset, 'id_asset' => $this->id_asset,
]); ]);
$recount_tags = [];
if(!empty($rows))
foreach($rows as $row)
$recount_tags[] = $row['id_tag'];
$db->query(' $db->query('
DELETE FROM assets_tags DELETE FROM assets_tags
WHERE id_asset = {int:id_asset}', WHERE id_asset = {int:id_asset}',
@ -524,7 +519,7 @@ class Asset
$rows = $db->query(' $rows = $db->query('
SELECT id_tag SELECT id_tag
FROM tags FROM tags
WHERE id_asset_thumb = {int:id_asset} AND kind = "Album"', WHERE id_asset_thumb = {int:id_asset}',
[ [
'id_asset' => $this->id_asset, 'id_asset' => $this->id_asset,
]); ]);