mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
Stop walking SD card libraries on every session start and game launch (#2533)
* Stop searching whole libraries on every game launch and session start The install script search ran over every library whenever any game's manifest changed, and again on each launch. It now runs per game, only when that game's build changes, and a launch that names its scripts does no search at all. A store game's shortcut walked its install folder on every scan instead of reusing the ranking the scan keeps. * Search a library for install scripts after the session has started, not before * fix(session): keep deferred seeding off a running prefix and recheck old folder caches * test(session): bound the held library search in the deferred seeding test * fix(session): search a game again when its install script search failed
This commit is contained in:
1 parent
39a4a1b60c
commit
b5f6122d49
6 files changed
+204
-15
No files matched your search
@@ -97,7 +97,7 @@ object AddedGames {
|
||||
return File(LinuxRuntime.rootDir(context), guest.removePrefix("/"))
|
||||
}
|
||||
|
||||
fun candidates(folder: File): List<File> = rank(folder).exes
|
||||
fun candidates(folder: File, reuse: Boolean = false): List<File> = rank(folder, reuse).exes
|
||||
|
||||
fun rank(folder: File, reuse: Boolean = false): GameExePicker.Ranking {
|
||||
val key = "${folder.path}|${folder.lastModified()}"
|
||||
|
||||
@@ -374,7 +374,7 @@ object BattleNet {
|
||||
val guestPrefix = added.guestPath(context, prefix(context)) ?: return null
|
||||
val crc = java.util.zip.CRC32().apply { update("\"$guestExe\"${game.name}".toByteArray()) }.value
|
||||
val appId = com.droiddeck.launcher.session.SessionPrefs.addedGameAppId(context, game.folder.path, crc or 0x80000000L)
|
||||
val exe = added.candidates(game.folder).firstOrNull() ?: client
|
||||
val exe = added.candidates(game.folder, reuse = true).firstOrNull() ?: client
|
||||
return com.droiddeck.launcher.frontend.AddedGames.Game(
|
||||
game.folder, game.name, exe, guestExe, guestDir, appId, (appId shl 32) or 0x02000000L, listOf(exe),
|
||||
source = com.droiddeck.launcher.stores.Store.BATTLENET.id, storeId = game.uid,
|
||||
|
||||
Reference in new issue
Block a user