Browse Source

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
merge-requests/1535/head
Nicolas Pomepuy 4 years ago
parent
commit
8dad40500b
  1. 6
      application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt

6
application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt

@ -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)

Loading…
Cancel
Save