[Android] ML: Encode mrls for ban/unban folder

Geoffrey Métais git at videolan.org
Mon Dec 11 17:34:44 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Dec 11 17:34:09 2017 +0100| [fa848ebb731889ec36230ef712f012361cb1aada] | committer: Geoffrey Métais

ML: Encode mrls for ban/unban folder

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

 medialibrary/src/org/videolan/medialibrary/Medialibrary.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
index 04e7a683d..1cb65ac5c 100644
--- a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
+++ b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
@@ -98,12 +98,12 @@ public class Medialibrary {
 
     public void banFolder(@NonNull String path) {
         if (mIsInitiated && new File(path).exists())
-            nativeBanFolder(path);
+            nativeBanFolder(Tools.encodeVLCMrl(path));
     }
 
     public void unbanFolder(@NonNull String path) {
         if (mIsInitiated && new File(path).exists())
-            nativeUnbanFolder(path);
+            nativeUnbanFolder(Tools.encodeVLCMrl(path));
     }
 
     public String[] getDevices() {
@@ -120,9 +120,8 @@ public class Medialibrary {
     }
 
     public void removeFolder(@NonNull String mrl) {
-        if (!mIsInitiated)
-            return;
-        String[] folders = getFoldersList();
+        if (!mIsInitiated) return;
+        final String[] folders = getFoldersList();
         for (String folder : folders) {
             if (!folder.equals(mrl) && folder.contains(mrl))
                 removeFolder(folder);



More information about the Android mailing list