mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
Added games: a reused ranking is not remembered as a fresh walk
A ranking a scan took from added-games-scan.json was also put in the 60-second in-memory cache with the current time, so for the next minute single(), addFolder() and the exe picker, which ask for a fresh walk, got a ranking that could be a week old. Kept rankings are now returned without entering that cache, so it only ever holds rankings from real walks.
This commit is contained in:
1 parent
df60fdb194
commit
cb3c3cb2c9
2 files changed
+18
-1
No files matched your search
@@ -103,7 +103,7 @@ object AddedGames {
|
||||
val key = "${folder.path}|${folder.lastModified()}"
|
||||
val now = System.currentTimeMillis()
|
||||
ranked[key]?.takeIf { now - it.first < RANK_FRESH_MS }?.let { return it.second }
|
||||
if (reuse) kept?.rank(folder)?.let { ranked[key] = now to it; return it }
|
||||
if (reuse) kept?.rank(folder)?.let { return it }
|
||||
val guessed = GameExePicker.rank(folder) { !skipExe(it.name) }
|
||||
val declared = declaredExes(folder)
|
||||
val preferred = declared.map { it.path }.toSet()
|
||||
|
||||
Reference in new issue
Block a user