do not cache empty thumbnail lists
This commit is contained in:
@ -1037,6 +1037,12 @@ function getCachedThumbnail(thumbnailUrl: string): SongThumbnailImage[] | null {
|
||||
}
|
||||
|
||||
function cacheThumbnail(thumbnailUrl: string, thumbnails: SongThumbnailImage[]) {
|
||||
if (!thumbnails) {
|
||||
// This usually means, that the data is being saved to cached,
|
||||
// while the thumbnail generation is not finished yet
|
||||
logger.debug('will not cache empty thumbnail list', thumbnailUrl);
|
||||
return;
|
||||
}
|
||||
const now = new Date().getTime();
|
||||
const initialSize = thumbnailCache.size;
|
||||
if (initialSize >= maxThumbnailCacheSize) {
|
||||
|
Reference in New Issue
Block a user