[Android] Avoid duplicated calls to removeFolders

Nicolas Pomepuy git at videolan.org
Mon Feb 8 07:20:13 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Feb  4 14:03:44 2021 +0100| [9b156ef0c0567cb5f690ccd50d103d4f199492be] | committer: Nicolas Pomepuy

Avoid duplicated calls to removeFolders

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

 medialibrary/src/org/videolan/medialibrary/MedialibraryImpl.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/MedialibraryImpl.java b/medialibrary/src/org/videolan/medialibrary/MedialibraryImpl.java
index cbd3626ea..146c5d19c 100644
--- a/medialibrary/src/org/videolan/medialibrary/MedialibraryImpl.java
+++ b/medialibrary/src/org/videolan/medialibrary/MedialibraryImpl.java
@@ -140,8 +140,9 @@ public class MedialibraryImpl extends Medialibrary {
         if (!mIsInitiated) return;
         final String[] folders = getFoldersList();
         for (String folder : folders) {
-            if (!folder.equals(mrl) && folder.contains(mrl))
+            if (!folder.equals(mrl) && !folder.equals(mrl+"/") && folder.contains(mrl)) {
                 removeFolder(folder);
+            }
         }
         nativeRemoveEntryPoint(Tools.encodeVLCMrl(mrl));
     }



More information about the Android mailing list