[Android] Retrieve bitmap from artworks list. Clean-up logic.

Robert Stone git at videolan.org
Tue May 18 07:28:34 UTC 2021


vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Mon May 17 23:26:52 2021 -0700| [b4c68762b89be0b30ecb8a888aa8277e0d6faf81] | committer: Robert Stone

Retrieve bitmap from artworks list. Clean-up logic.

> https://code.videolan.org/videolan/vlc-android/commit/b4c68762b89be0b30ecb8a888aa8277e0d6faf81
---

 .../vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt b/application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
index 4183587bd..5f7099f3a 100644
--- a/application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
+++ b/application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
@@ -132,7 +132,7 @@ object ThumbnailsProvider {
 
             val artworkAlreadyHere = artworks.any { it.artworkURL == mediaWrapper.artworkURL }
 
-            if (mediaWrapper.artworkURL != null && mediaWrapper.artworkURL.isNotBlank() && !artworkAlreadyHere) {
+            if (!artworkAlreadyHere && !mediaWrapper.artworkURL.isNullOrBlank()) {
                 artworks.add(mediaWrapper)
             }
             if (artworks.size > 3) {
@@ -158,7 +158,7 @@ object ThumbnailsProvider {
         val artworks = getArtworkListForPlaylist(mediaList)
         if (artworks.isEmpty()) return null
 
-        val sameImage = if (artworks.size == 1) obtainBitmap(mediaList[0], width)
+        val sameImage = if (artworks.size == 1) obtainBitmap(artworks[0], width)
                 ?: return null else null
 
         val cs = Bitmap.createBitmap(width, width, Bitmap.Config.ARGB_8888)



More information about the Android mailing list