Fixed artists tab lag

This commit is contained in:
Prathamesh More 2021-10-27 16:52:44 +05:30
parent 8422e5abbd
commit 271cff7283

View file

@ -26,7 +26,6 @@ import com.bumptech.glide.annotation.GlideType
import com.bumptech.glide.load.Key import com.bumptech.glide.load.Key
import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.request.BaseRequestOptions import com.bumptech.glide.request.BaseRequestOptions
import com.bumptech.glide.request.target.Target.SIZE_ORIGINAL
import com.bumptech.glide.signature.MediaStoreSignature import com.bumptech.glide.signature.MediaStoreSignature
import java.io.File import java.io.File
@ -79,7 +78,11 @@ object RetroGlideExtension {
) )
} }
private fun getArtistModel(artist: Artist, hasCustomImage: Boolean, forceDownload: Boolean): Any { private fun getArtistModel(
artist: Artist,
hasCustomImage: Boolean,
forceDownload: Boolean
): Any {
return if (!hasCustomImage) { return if (!hasCustomImage) {
ArtistImage(artist) ArtistImage(artist)
} else { } else {
@ -97,7 +100,6 @@ object RetroGlideExtension {
.diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY_ARTIST) .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY_ARTIST)
.priority(Priority.LOW) .priority(Priority.LOW)
.error(DEFAULT_ERROR_ARTIST_IMAGE) .error(DEFAULT_ERROR_ARTIST_IMAGE)
.override(SIZE_ORIGINAL, SIZE_ORIGINAL)
.signature(createSignature(artist)) .signature(createSignature(artist))
} }