[Android] Filter storages in medialibrary settings
Geoffrey Métais
git at videolan.org
Mon Sep 24 11:45:06 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Sep 24 10:17:39 2018 +0200| [be103e1fdc3586843d78e2e94447abd87d89bf5d] | committer: Geoffrey Métais
Filter storages in medialibrary settings
> https://code.videolan.org/videolan/vlc-android/commit/be103e1fdc3586843d78e2e94447abd87d89bf5d
---
vlc-android/src/org/videolan/vlc/providers/StorageProvider.kt | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/providers/StorageProvider.kt b/vlc-android/src/org/videolan/vlc/providers/StorageProvider.kt
index 68ec3fc61..865aa9a50 100644
--- a/vlc-android/src/org/videolan/vlc/providers/StorageProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/providers/StorageProvider.kt
@@ -23,15 +23,12 @@ package org.videolan.vlc.providers
import android.content.Context
import android.net.Uri
import android.text.TextUtils
-import kotlinx.coroutines.experimental.Job
-import kotlinx.coroutines.experimental.android.UI
-import kotlinx.coroutines.experimental.launch
import org.videolan.medialibrary.media.MediaLibraryItem
import org.videolan.medialibrary.media.MediaWrapper
import org.videolan.medialibrary.media.Storage
import org.videolan.vlc.R
-import org.videolan.vlc.util.AndroidDevices
import org.videolan.vlc.repository.DirectoryRepository
+import org.videolan.vlc.util.AndroidDevices
import org.videolan.vlc.util.LiveDataset
import java.io.File
import java.util.*
@@ -44,6 +41,7 @@ class StorageProvider(context: Context, dataset: LiveDataset<MediaLibraryItem>,
var storage: Storage
val storagesList = ArrayList<MediaLibraryItem>()
for (mediaDirLocation in storages) {
+ if (!File(mediaDirLocation).exists()) continue
if (TextUtils.isEmpty(mediaDirLocation)) continue
storage = Storage(Uri.fromFile(File(mediaDirLocation)))
if (TextUtils.equals(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY, mediaDirLocation))
More information about the Android
mailing list