Skip to content
Snippets Groups Projects
Commit 08e8d839 authored by Duncan McNamara's avatar Duncan McNamara Committed by Nicolas Pomepuy
Browse files

MLStorage: fix double sd appearing

Checking to see if the directory is readable removes the wrong
sd card
parent e82bccaf
No related branches found
No related tags found
1 merge request!1938MLStorage: fix double sd appearing
Pipeline #488388 passed with stage
in 5 minutes
......@@ -45,7 +45,8 @@ class StorageProvider(context: Context, dataset: LiveDataset<MediaLibraryItem>,
var storage: Storage
val storagesList = ArrayList<MediaLibraryItem>()
for (mediaDirLocation in storages) {
if (!File(mediaDirLocation).exists()) continue
val file = File(mediaDirLocation)
if (!file.exists() || !file.canRead()) continue
if (mediaDirLocation.isEmpty()) continue
storage = Storage(Uri.fromFile(File(mediaDirLocation)))
if (AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY == mediaDirLocation)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment