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