From 4b0404c90aafbd9f29b5a0ca5833d4416b3d1106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 21 Sep 2023 10:15:04 +0200 Subject: [PATCH] Introduce CoverArtCache::requestUncachedCover() --- src/library/coverartcache.cpp | 19 ++++++++++++++++++- src/library/coverartcache.h | 5 +++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/library/coverartcache.cpp b/src/library/coverartcache.cpp index e7e9dc23fbca..dd82760cb173 100644 --- a/src/library/coverartcache.cpp +++ b/src/library/coverartcache.cpp @@ -57,7 +57,7 @@ void CoverArtCache::requestCover( pRequester, pTrack, coverInfo, - desiredWidth, // original size + desiredWidth, Loading::Default); } @@ -103,6 +103,23 @@ QPixmap CoverArtCache::getCachedCover( return pixmap; } +// static +void CoverArtCache::requestUncachedCover( + const QObject* pRequester, + const CoverInfo& coverInfo, + int desiredWidth) { + CoverArtCache* pCache = CoverArtCache::instance(); + VERIFY_OR_DEBUG_ASSERT(pCache) { + return; + } + pCache->tryLoadCover( + pRequester, + TrackPointer(), + coverInfo, + desiredWidth, + Loading::Default); +} + QPixmap CoverArtCache::tryLoadCover( const QObject* pRequester, const TrackPointer& pTrack, diff --git a/src/library/coverartcache.h b/src/library/coverartcache.h index 2fa16f031b5d..331e51c089a4 100644 --- a/src/library/coverartcache.h +++ b/src/library/coverartcache.h @@ -29,6 +29,11 @@ class CoverArtCache : public QObject, public Singleton { const CoverInfo& coverInfo, int desiredWidth); + static void requestUncachedCover( + const QObject* pRequester, + const CoverInfo& coverInfo, + int desiredWidth); + enum class Loading { CachedOnly, NoSignal,