feat(storage): name, select and remove every prefix and store game (#2565)

* feat(storage): name, select and remove every prefix and store game

* feat(storage): bulk remove picks prefixes, shader caches or both

* fix(storage): count and clear a game's shader cache in every library

* fix(storage): guard shared prefixes, batches and active downloads

* fix(storage): count each shader cache once across games

* fix(storage): hold store uninstalls against downloads and keep every shortcut's options

* fix(stores): keep download cleanup and uninstall from overlapping

* fix(stores): wait for an installer's file discard before uninstalling

* fix(stores): a reinstall waits for the cancelled download's file cleanup

* fix(storage): fast first scan, readable 4:3 layout and every shader cache counted

* fix(storage): keep store sizes current and track discards from failing jobs

* fix(stores): uninstall waits for a cancelled update's cleanup

* test(stores): a reinstall waits for a failed job's discard
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-13 12:32:24 -05:00
1 parent 69b612be1f
commit 58af2e136b
45 files changed
+1494 -146

No files matched your search

@@ -1281,6 +1281,11 @@ object SessionPrefs {
fun addedGameStoredAppId(context: Context, folderPath: String): Long? =
prefs(context).getLong("addedAppId:$folderPath", 0L).takeIf { it != 0L }
fun addedGameFolders(context: Context): Map<Long, String> = prefs(context).all.mapNotNull { (key, value) ->
val id = (value as? Long)?.takeIf { key.startsWith("addedAppId:") && it != 0L } ?: return@mapNotNull null
(id and 0xFFFFFFFFL) to key.removePrefix("addedAppId:")
}.toMap()
fun followStoreGame(context: Context, key: String, folderPath: String, gone: (String) -> Boolean) = synchronized(addedGameLock) {
val p = prefs(context)
val previous = p.getString("storeFolder:$key", null)