mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
fix: read installed depots from completed manifest names too
This commit is contained in:
1 parent
be5f1560b2
commit
0cc187025f
5 files changed
+43
-4
No files matched your search
@@ -137,10 +137,13 @@ object SteamLibraries {
|
||||
val managed = AddedGames.steamInstallDirs(common)
|
||||
return common.listFiles { f ->
|
||||
f.isDirectory && f.name.lowercase() !in managed &&
|
||||
File(f, ".download_complete").isFile && File(f, ".DepotDownloader/depot.config").isFile
|
||||
File(f, ".download_complete").isFile && depotRecord(File(f, ".DepotDownloader"))
|
||||
}.orEmpty().sortedBy { it.name.lowercase() }
|
||||
}
|
||||
|
||||
private fun depotRecord(dir: File): Boolean = File(dir, "depot.config").isFile ||
|
||||
File(dir, "completed").list()?.any { it.matches(Regex("\\d+_\\d+\\.manifest")) } == true
|
||||
|
||||
fun rename(context: Context, id: String, label: String) {
|
||||
val name = clean(label).takeIf { it.isNotEmpty() } ?: return
|
||||
synchronized(lock) { save(context, list(context).map { if (it.id == id) Entry(it.id, it.path, name) else it }) }
|
||||
|
||||
@@ -104,8 +104,13 @@ class SteamLibrariesTest {
|
||||
depotInstall(common, "Partial", complete = false)
|
||||
depotInstall(common, "Managed")
|
||||
File(steam, "steamapps/appmanifest_42.acf").writeText("\"AppState\"\n{\n\t\"installdir\"\t\t\"Managed\"\n}\n")
|
||||
assertEquals(listOf(done), SteamLibraries.depotInstalls(common))
|
||||
assertEquals(2, SteamLibraries.gameCount(steam))
|
||||
val migrated = File(common, "Migrated").apply {
|
||||
File(this, ".DepotDownloader/completed").mkdirs()
|
||||
File(this, ".DepotDownloader/completed/43_99.manifest").writeBytes(ByteArray(4))
|
||||
File(this, ".download_complete").writeText("")
|
||||
}
|
||||
assertEquals(listOf(done, migrated), SteamLibraries.depotInstalls(common))
|
||||
assertEquals(3, SteamLibraries.gameCount(steam))
|
||||
assertEquals(steam, SteamLibraries.innerLibrary(steam.parentFile))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user