Skip to content

Commit

Permalink
Introduce CoverArtCache::requestUncachedCover()
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Sep 22, 2023
1 parent 6ff00f3 commit 4b0404c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/library/coverartcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void CoverArtCache::requestCover(
pRequester,
pTrack,
coverInfo,
desiredWidth, // original size
desiredWidth,
Loading::Default);
}

Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions src/library/coverartcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class CoverArtCache : public QObject, public Singleton<CoverArtCache> {
const CoverInfo& coverInfo,
int desiredWidth);

static void requestUncachedCover(
const QObject* pRequester,
const CoverInfo& coverInfo,
int desiredWidth);

enum class Loading {
CachedOnly,
NoSignal,
Expand Down

0 comments on commit 4b0404c

Please sign in to comment.