[Android] Use common path for media without cover artwork

Robert Stone git at videolan.org
Fri Jul 9 09:12:04 UTC 2021


vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Tue Jul  6 22:15:09 2021 -0700| [26bfa3e9f4d20854b9c3e7291ff5888db92a55ca] | committer: Nicolas Pomepuy

Use common path for media without cover artwork

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

 application/vlc-android/src/org/videolan/vlc/ArtworkProvider.kt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/ArtworkProvider.kt b/application/vlc-android/src/org/videolan/vlc/ArtworkProvider.kt
index 258312371..48a654e9b 100644
--- a/application/vlc-android/src/org/videolan/vlc/ArtworkProvider.kt
+++ b/application/vlc-android/src/org/videolan/vlc/ArtworkProvider.kt
@@ -456,10 +456,11 @@ class ArtworkProvider : ContentProvider() {
          * Construct the URI for MediaWrappers
          */
         fun buildMediaUri(media: MediaWrapper): Uri {
+            val audioNoArtwork = media.type == MediaWrapper.TYPE_AUDIO && media.artworkMrl.isNullOrEmpty()
             return buildUri(Uri.Builder()
                     .appendPath(MEDIA)
-                    .appendPath("${media.lastModified}")
-                    .appendPath("${media.id}")
+                    .appendPath("${if (audioNoArtwork) 0L else media.lastModified}")
+                    .appendPath("${if (audioNoArtwork) 0L else media.id}")
                     .build())
         }
 



More information about the Android mailing list