Commit db4863b0 authored by Geoffrey Métais's avatar Geoffrey Métais

Filter storage detection on specific devices only

parent 34d3d19e
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment