From 9f71b72041fc3e03aa861716d8813b62964f766a Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Thu, 4 Jun 2026 09:13:35 +0300 Subject: [PATCH] coverart: Use latest version if requested version is greater This is to assist local development, which uses ifdb.org as an image source, and might advance the version during testing. --- www/coverart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/www/coverart b/www/coverart index b7eff56a..1a0d9372 100644 --- a/www/coverart +++ b/www/coverart @@ -105,8 +105,17 @@ if ($targVsn) { if (isset($deltas['title'])) $title = $deltas['title']; + $pagevsn = (int)$rec['pagevsn']; + + // Hack to assist local development, which uses production as an image source. + // If the target version is above what the server knows about, return the latest version. + if ($i == 0 && $pagevsn < $targVsn) { + $foundvsn = true; + break; + } + // stop if this is the version we're looking for - if ((int)$rec['pagevsn'] == $targVsn) + if ($pagevsn == $targVsn) { $foundvsn = true; break; @@ -133,4 +142,4 @@ if (isset($_REQUEST['version'])) { } // send it -sendImage($imgdata, $fmt, $thumbnail); \ No newline at end of file +sendImage($imgdata, $fmt, $thumbnail);