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

Filter storage detection on specific devices only

(cherry picked from commit db4863b0)
parent b1749ced
No related branches found
No related tags found
No related merge requests found
Pipeline #6956 failed with stage
in 3 minutes and 53 seconds
......@@ -135,11 +135,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