Separated cache entries for large images

This commit is contained in:
Nite 2021-06-07 21:38:39 +02:00
parent fa6566e903
commit 78cb4d09cf
No known key found for this signature in database
GPG Key ID: 1D1AD59B1C6386C1
2 changed files with 4 additions and 3 deletions

View File

@ -129,9 +129,10 @@ public class FileUtil
/** /**
* Get the cache key for a given album entry * Get the cache key for a given album entry
* @param entry The album entry * @param entry The album entry
* @param large Whether to get the key for the large or the default image
* @return String The hash key * @return String The hash key
*/ */
public static String getAlbumArtKey(MusicDirectory.Entry entry) public static String getAlbumArtKey(MusicDirectory.Entry entry, boolean large)
{ {
File albumDir = getAlbumDirectory(entry); File albumDir = getAlbumDirectory(entry);
File albumArtDir = getAlbumArtDirectory(); File albumArtDir = getAlbumArtDirectory();
@ -140,7 +141,7 @@ public class FileUtil
return null; return null;
} }
return String.format(Locale.ROOT, "%s.jpeg", Util.md5Hex(albumDir.getPath())); return String.format(Locale.ROOT, "%s%b.jpeg", Util.md5Hex(albumDir.getPath()), large);
} }

View File

@ -80,7 +80,7 @@ class ImageLoader(
val requestedSize = resolveSize(size, large) val requestedSize = resolveSize(size, large)
if (id != null && id.isNotEmpty() && view is ImageView) { if (id != null && id.isNotEmpty() && view is ImageView) {
val key = FileUtil.getAlbumArtKey(entry) val key = FileUtil.getAlbumArtKey(entry, large)
val request = ImageRequest.CoverArt( val request = ImageRequest.CoverArt(
id, key, view, requestedSize, id, key, view, requestedSize,
placeHolderDrawableRes = defaultResourceId, placeHolderDrawableRes = defaultResourceId,