mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
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:
1 parent
69b612be1f
commit
58af2e136b
45 files changed
+1494
-146
No files matched your search
@@ -529,6 +529,17 @@ object AddedGames {
|
||||
}
|
||||
}
|
||||
|
||||
class Listed(val appId: Long, val name: String, val launchOptions: String)
|
||||
|
||||
fun listed(context: Context): List<Listed>? = runCatching {
|
||||
val file = File(context.filesDir, "session/added-games.json")
|
||||
if (!file.isFile) return null
|
||||
val entries = org.json.JSONArray(file.readText())
|
||||
(0 until entries.length()).mapNotNull { i ->
|
||||
entries.optJSONObject(i)?.takeIf { it.has("appid") }?.let { Listed(it.optLong("appid") and 0xFFFFFFFFL, it.optString("name"), it.optString("launch")) }
|
||||
}
|
||||
}.getOrNull()
|
||||
|
||||
fun writeListing(context: Context, games: List<Game>,
|
||||
extra: List<JSONObject> = listOfNotNull(com.droiddeck.launcher.stores.epic.EpicClient.steamListing(context))): File {
|
||||
val file = File(context.filesDir, "session/added-games.json").apply { parentFile?.mkdirs() }
|
||||
|
||||
Reference in new issue
Block a user