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

Duncan McNamara git at videolan.org
Tue Jan 24 15:37:00 UTC 2023


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Jan 12 18:43:34 2023 +0100| [1cf5481d90740cdb5296bb9fe37430cbac7bee84] | 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.

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

 .../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 009cb9a4ea..88cfb71bf1 100644
--- a/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
+++ b/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
@@ -394,7 +394,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