[Android] History: display even if no storage access

Duncan McNamara git at videolan.org
Mon Feb 14 09:15:39 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Fri Jan 28 14:29:04 2022 +0100| [d90b29d77c3f7f2aed0ff505dacee57fac0a39b0] | committer: Duncan McNamara

History: display even if no storage access

If there is no storage access, the medialibrary isn't started. Though to
have a history and to display it, the medialibrary must be started. This
doesn't affect other views as they are deactivated when there is no
storage access.

Fixes #2341

> https://code.videolan.org/videolan/vlc-android/commit/d90b29d77c3f7f2aed0ff505dacee57fac0a39b0
---

 .../resources/src/main/java/org/videolan/resources/util/Extensions.kt   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/resources/src/main/java/org/videolan/resources/util/Extensions.kt b/application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
index a17083948..6281583e0 100644
--- a/application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
+++ b/application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
@@ -71,7 +71,7 @@ suspend inline fun waitForML() = withContext(Dispatchers.IO) {
 }
 
 fun Context.startMedialibrary(firstRun: Boolean = false, upgrade: Boolean = false, parse: Boolean = true, removeDevices:Boolean = false, coroutineContextProvider: CoroutineContextProvider = CoroutineContextProvider()) = AppScope.launch {
-    if (Medialibrary.getInstance().isStarted || !canReadStorage(this at startMedialibrary)) return at launch
+    if (Medialibrary.getInstance().isStarted) return at launch
     val prefs = withContext(coroutineContextProvider.IO) { Settings.getInstance(this at startMedialibrary) }
     val scanOpt = if (Settings.showTvUi) ML_SCAN_ON else prefs.getInt(KEY_MEDIALIBRARY_SCAN, -1)
     if (parse && scanOpt == -1) {



More information about the Android mailing list