Skip to content
Snippets Groups Projects
Commit db4863b0 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Filter storage detection on specific devices only

parent 34d3d19e
No related branches found
No related tags found
No related merge requests found
Pipeline #6955 passed with stage
in 3 minutes and 54 seconds
......@@ -141,11 +141,12 @@ fun MutableList<MediaWrapper>.updateWithMLMeta() : MutableList<MediaWrapper> {
return this
}
@ExperimentalCoroutinesApi
@ObsoleteCoroutinesApi
suspend fun String.scanAllowed() = withContext(Dispatchers.IO) {
val file = File(Uri.parse(this@scanAllowed).path)
if (!file.exists() || !file.canRead()) return@withContext false
val children = file.list() ?: return@withContext true
for (child in children) if (child == ".nomedia") return@withContext false
if (AndroidDevices.watchDevices && file.list()?.any { it == ".nomedia" } == true) return@withContext false
true
}
......
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