Skip to content
Snippets Groups Projects
Commit 8dad4050 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Prevent setting the non-indexed media artworkUrl that is not saved on disk

If the cache is cleared in the meantime, the app will only try to retrieve the
artworkUrl file that is not existing and then fail
Fixes #2600
parent 17f2daf1
No related branches found
No related tags found
1 merge request!1519Prevent setting the non-indexed media artworkUrl that is not saved on disk
Pipeline #261466 passed with stage
in 21 minutes and 22 seconds
......@@ -95,8 +95,10 @@ object ThumbnailsProvider {
BitmapCache.addBitmapToMemCache(getMediaCacheKey(true, media, width.toString()), bitmap)
if (hasCache) {
media.setThumbnail(thumbPath)
if (media.id > 0) BitmapUtil.saveOnDisk(bitmap, thumbPath)
media.artworkURL = thumbPath
if (media.id > 0) {
BitmapUtil.saveOnDisk(bitmap, thumbPath)
media.artworkURL = thumbPath
}
}
} else if (media.id != 0L) {
media.requestThumbnail(width, 0.4f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment