From efe4125ae4755ed91c19324d335c8724e0f63d32 Mon Sep 17 00:00:00 2001 From: Jim Mason Date: Mon, 27 May 2024 18:59:41 +0100 Subject: [PATCH] avoid bulk album query if no library albums are present --- engine/impl/Library.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/impl/Library.php b/engine/impl/Library.php index 72505aca..7c363d7b 100644 --- a/engine/impl/Library.php +++ b/engine/impl/Library.php @@ -426,6 +426,9 @@ public function linkReviews(&$albums, $loggedIn = false, $includeBody = false) { } } + if(count($tags) == 0) + return; + $ib = $includeBody?"":"null"; $query = "SELECT tag, a.airname, realname, r.id, r.created, r.private, " . "$ib review FROM reviews r " . @@ -468,6 +471,10 @@ public function markAlbumsReviewed(&$albums, $loggedIn = 0) { $tags[$tag] = $i; } } + + if(count($tags) == 0) + return; + $query = "SELECT tag, a.airname, realname FROM reviews r " . "LEFT JOIN users u ON r.user = u.name " . "LEFT JOIN airnames a ON r.airname = a.id WHERE " . @@ -515,6 +522,9 @@ public function markAlbumsPlayable(&$albums) { } } + if(count($tags) == 0) + return; + $urlFilter = $enableExternalLinks ? "url <> ''" : "url RLIKE ?"; $query = "SELECT tag FROM tracknames ".