[Android] MediaWrapper: fix issue with smb title being empty

Duncan McNamara git at videolan.org
Wed Jan 25 06:18:31 UTC 2023


vlc-android | branch: 3.5.x | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Jan 12 18:43:34 2023 +0100| [d33e43e50ff6ffc84ed462f2ef0419ea869e1883] | committer: Nicolas Pomepuy

MediaWrapper: fix issue with smb title being empty

Filenames with smb share titles will be null, meaning that title from
libvlc will never be chosen, causing an empty string to be chosen down
the line as title.

(cherry picked from commit 1cf5481d90740cdb5296bb9fe37430cbac7bee84)

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

 .../src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java b/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
index d81e60b15a..b2f38aafa1 100644
--- a/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
+++ b/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
@@ -391,7 +391,7 @@ public abstract class MediaWrapper extends MediaLibraryItem implements Parcelabl
     private String updateTitleMeta(IMedia media) {
         String libvlcTitle = getMetaId(media, mTitle, Media.Meta.Title, true);
         String fileName = getFileName();
-        if (!TextUtils.isEmpty(libvlcTitle) && !TextUtils.isEmpty(fileName) && !libvlcTitle.equals(fileName))
+        if (TextUtils.isEmpty(fileName) || fileName.equals(libvlcTitle))
             return libvlcTitle;
         return getTitle();
     }



More information about the Android mailing list