[Android] Storages: Check mrl format before saving

Geoffrey Métais git at videolan.org
Mon Feb 19 14:47:36 CET 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 19 09:50:52 2018 +0100| [693b5017a3b3e24d8cad9b7f1f2435e67f18bdd6] | committer: Geoffrey Métais

Storages: Check mrl format before saving

(cherry picked from commit 338810a06ea6bcddc405c6e98746820b79bc22c9)

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

 .../src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java
index d81b34469..6c63db046 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java
@@ -89,18 +89,17 @@ class StorageBrowserAdapter extends BaseBrowserAdapter {
     }
 
     void updateMediaDirs() {
-        if (mMediaDirsLocation != null)
-            mMediaDirsLocation.clear();
-        String folders[] = VLCApplication.getMLInstance().getFoldersList();
+        if (mMediaDirsLocation != null) mMediaDirsLocation.clear();
+        final String folders[] = VLCApplication.getMLInstance().getFoldersList();
         mMediaDirsLocation = new ArrayList<>(folders.length);
         for (String folder : folders) {
-            mMediaDirsLocation.add(folder.substring(7));
+            mMediaDirsLocation.add(folder.startsWith("file://") ? folder.substring(7) : folder);
         }
         mCustomDirsLocation = new ArrayList<>(Arrays.asList(CustomDirectories.getCustomDirectories()));
     }
 
     protected void checkBoxAction(View v, String mrl) {
-        ThreeStatesCheckbox tscb = (ThreeStatesCheckbox) v;
+       final  ThreeStatesCheckbox tscb = (ThreeStatesCheckbox) v;
         int state = tscb.getState();
         if (state == ThreeStatesCheckbox.STATE_CHECKED)
             MedialibraryUtils.addDir(mrl);



More information about the Android mailing list