mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 13:26:02 +00:00
fix: find Steam libraries whose installs have no appmanifest
This commit is contained in:
1 parent
9f6c73442b
commit
be5f1560b2
3 files changed
+50
-2
No files matched your search
@@ -126,8 +126,20 @@ object SteamLibraries {
|
||||
return out
|
||||
}
|
||||
|
||||
internal fun gameCount(library: File): Int =
|
||||
File(library, "steamapps").list()?.count { it.startsWith("appmanifest_") && it.endsWith(".acf") } ?: 0
|
||||
internal fun gameCount(library: File): Int {
|
||||
val steamapps = File(library, "steamapps")
|
||||
val manifests = steamapps.list()?.count { it.startsWith("appmanifest_") && it.endsWith(".acf") } ?: return 0
|
||||
return manifests + depotInstalls(File(steamapps, "common")).size
|
||||
}
|
||||
|
||||
/** Finished downloads another client left without a Steam manifest; the importer registers them from depot.config. */
|
||||
fun depotInstalls(common: File): List<File> {
|
||||
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
|
||||
}.orEmpty().sortedBy { it.name.lowercase() }
|
||||
}
|
||||
|
||||
fun rename(context: Context, id: String, label: String) {
|
||||
val name = clean(label).takeIf { it.isNotEmpty() } ?: return
|
||||
|
||||
Reference in new issue
Block a user