[Android] Fix the UPnP audio media thumb being blank if the media has already been played

Nicolas Pomepuy git at videolan.org
Thu Apr 1 13:03:58 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Mar 31 08:47:51 2021 +0200| [2277fd82037782ce0b8b1fbd116c85e7a2b5e0c6] | committer: Nicolas Pomepuy

Fix the UPnP audio media thumb being blank if the media has already been played

Fixes #1461

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

 application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt   | 1 -
 .../vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt       | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 700ee3a5c..65419f99d 100644
--- a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -431,7 +431,6 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
 
     fun saveMediaMeta() = launch(start = CoroutineStart.UNDISPATCHED) {
         val titleIdx = player.getTitleIdx()
-        val chapterIdx = player.getChapterIdx()
         val currentMedia = getCurrentMedia() ?: return at launch
         if (currentMedia.uri.scheme == "fd") return at launch
         //Save progress
diff --git a/application/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt b/application/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
index 8e6111ded..67b44eabd 100644
--- a/application/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+++ b/application/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
@@ -338,7 +338,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
         }
         val uri = mw.uri
         if ((mw.type == MediaWrapper.TYPE_AUDIO || mw.type == MediaWrapper.TYPE_VIDEO)) return withContext(coroutineContextProvider.IO) {
-            medialibrary.getMedia(uri) ?: mw
+            medialibrary.getMedia(uri).apply { if (this != null && this.artworkURL.isNullOrEmpty() && mw.artworkURL?.isNotEmpty() == true) this.artworkURL = mw.artworkURL } ?: mw
         }
         return mw
     }



More information about the Android mailing list