summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java/org
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2026-08-03 20:17:54 +0200
committerJosJuice <josjuice@gmail.com>2026-08-15 10:36:41 +0200
commitc64b02dace5e5e71dae9fbfbd258ffa3562573ef (patch)
tree31698ddde611744f9bdc2b2590faf0faa4a8b31f /Source/Android/app/src/main/java/org
parent9db6daadd89b2c3f01a434366d7295d43d7faf32 (diff)
Android: Remove runRescanAfterLoad from GameFileCacheManager
A small additional cleanup made possible by the previous commit.
Diffstat (limited to 'Source/Android/app/src/main/java/org')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheManager.kt14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheManager.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheManager.kt
index dc344bc3de..51ce4a4f2f 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheManager.kt
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheManager.kt
@@ -4,8 +4,10 @@ package org.dolphinemu.dolphinemu.services
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
+import androidx.lifecycle.asFlow
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
+import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting
@@ -24,7 +26,6 @@ object GameFileCacheManager {
private var gameFileCache: GameFileCache? = null
private val gameFiles = MutableLiveData(emptyArray<GameFile>())
private var firstLoadDone = false
- private var runRescanAfterLoad = false
private var recursiveScanEnabled = false
private val loadInProgress = MutableLiveData(false)
@@ -181,11 +182,6 @@ object GameFileCacheManager {
}
loadInProgress.value = false
-
- if (runRescanAfterLoad) {
- runRescanAfterLoad = false
- rescan()
- }
}
/**
@@ -195,9 +191,9 @@ object GameFileCacheManager {
* will be postponed until after load runs.
*/
private suspend fun rescan() {
- if (!firstLoadDone) {
- runRescanAfterLoad = true
- return
+ while (!firstLoadDone) {
+ // Wait until loadInProgress becomes false
+ loadInProgress.asFlow().first { !it }
}
withContext(Dispatchers.IO) {