diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt index 65fdf6e921..9b73f8cc87 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt @@ -70,7 +70,7 @@ object StoreInstalls { fun uninstall(context: Context, game: InstalledStoreGame, progress: (Float) -> Unit = {}, removed: () -> Unit = {}) { val app = context.applicationContext val appId = SessionPrefs.addedGameStoredAppId(app, game.folder.path) - val files = game.folder.walkBottomUp().toList() + val files = game.folder.walkBottomUp().onEnter { !Files.isSymbolicLink(it.toPath()) }.toList() val step = (files.size / 100).coerceAtLeast(1) files.forEachIndexed { i, f -> f.delete() @@ -98,6 +98,10 @@ object StoreInstalls { } fun deleteTree(dir: File) { + if (Files.isSymbolicLink(dir.toPath())) { + dir.delete() + return + } dir.listFiles()?.forEach { if (it.isDirectory) deleteTree(it) else it.delete() } dir.delete() } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoresState.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoresState.kt index 1fcbcd4815..282bcb16f2 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoresState.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoresState.kt @@ -212,9 +212,11 @@ object StoresState { } var pendingInstall by mutableStateOf(null) + var itchPicking by mutableStateOf(null) fun requestInstall(context: Context, item: CatalogItem) { askForNotifications(context) + if (item.store == Store.ITCH && item.extra["uploadId"].isNullOrEmpty()) { itchPicking = item; return } if (isUnfinished(item)) { install(context, item); return } val targets = StoreInstallRoot.targets(context) if (targets.size > 1 || StoreLanguage.selectable(item.store)) pendingInstall = item diff --git a/app/src/main/java/com/droiddeck/launcher/stores/download/SavedQueue.kt b/app/src/main/java/com/droiddeck/launcher/stores/download/SavedQueue.kt index a9a25759e1..e9a0acbcfa 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/download/SavedQueue.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/download/SavedQueue.kt @@ -79,7 +79,7 @@ object SavedQueue { put("image", i.imageUrl ?: ""); put("tall", i.tallImageUrl ?: "") i.logoUrl?.let { put("logo", it) } put("tags", i.tags); put("developer", i.developer); put("description", i.description) - put("size", i.sizeBytes); put("owned", i.owned); put("subscription", i.subscription) + put("size", i.sizeBytes); put("owned", i.owned); put("subscription", i.subscription); put("free", i.isFree) put("extra", JSONObject(i.extra)) } @@ -90,7 +90,7 @@ object SavedQueue { id = o.getString("id"), title = o.getString("title"), imageUrl = o.optString("image").ifEmpty { null }, tallImageUrl = o.optString("tall").ifEmpty { null }, tags = o.optString("tags"), developer = o.optString("developer"), description = o.optString("description"), - owned = o.optBoolean("owned", true), subscription = o.optBoolean("subscription"), sizeBytes = o.optLong("size"), + owned = o.optBoolean("owned", true), subscription = o.optBoolean("subscription"), isFree = o.optBoolean("free"), sizeBytes = o.optLong("size"), extra = extra?.keys()?.asSequence()?.associateWith { extra.getString(it) } ?: emptyMap(), logoUrl = o.optString("logo").ifEmpty { null }, ) diff --git a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchApi.kt b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchApi.kt index 92635630d9..496691feec 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchApi.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchApi.kt @@ -20,7 +20,7 @@ internal object ItchApi { fun ownedKeys(key: String, page: Int): JSONObject? = get("/profile/owned-keys?page=$page&per_page=500", key) fun uploads(key: String, gameId: String, downloadKeyId: String): JSONArray? = - get("/games/$gameId/uploads?download_key_id=$downloadKeyId", key)?.optJSONArray("uploads") + get("/games/$gameId/uploads" + keyQuery(downloadKeyId), key)?.optJSONArray("uploads") fun search(key: String, query: String, page: Int): JSONArray? { val q = java.net.URLEncoder.encode(query, "UTF-8") @@ -28,7 +28,9 @@ internal object ItchApi { } fun downloadUrl(uploadId: String, downloadKeyId: String): String = - "$BASE/uploads/$uploadId/download?download_key_id=$downloadKeyId" + "$BASE/uploads/$uploadId/download" + keyQuery(downloadKeyId) + + private fun keyQuery(downloadKeyId: String): String = if (downloadKeyId.isBlank()) "" else "?download_key_id=$downloadKeyId" fun pageUrl(slug: String): String = "$WEB/$slug" } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchBackend.kt b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchBackend.kt index b1bf834c15..66ca72602a 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchBackend.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchBackend.kt @@ -55,7 +55,7 @@ object ItchBackend : StoreBackend { override fun install(context: Context, item: CatalogItem, root: File) { val app = context.applicationContext - if (item.extra["downloadKeyId"].isNullOrEmpty()) { + if (item.extra["downloadKeyId"].isNullOrEmpty() && !item.isFree) { StoresState.logLine("itch.io: \"${item.title}\" is not in the library") return } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchGame.kt b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchGame.kt new file mode 100644 index 0000000000..39b69ea3fc --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchGame.kt @@ -0,0 +1,44 @@ +package com.droiddeck.launcher.stores.itch + +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.StoreNet +import org.json.JSONArray + +internal class ItchBuild( + val uploadId: String, + val filename: String, + val size: Long, + val updatedAt: String, + val platforms: Set, + val demo: Boolean, +) { + val installable: Boolean get() = "windows" in platforms +} + +internal object ItchGame { + private val PATH_AFTER = Regex("""name="itch:path"[^>]*content="games/(\d+)"""") + private val PATH_BEFORE = Regex("""content="games/(\d+)"[^>]*name="itch:path"""") + + fun idFromPage(html: String): String? = + PATH_AFTER.find(html)?.groupValues?.get(1) ?: PATH_BEFORE.find(html)?.groupValues?.get(1) + + fun resolveId(item: CatalogItem): String? { + item.extra["gameId"]?.takeIf { it.isNotBlank() }?.let { return it } + if (item.storeUrl.isBlank()) return null + val html = StoreNet.get(item.storeUrl) ?: return null + return idFromPage(html) + } + + fun builds(uploads: JSONArray?): List { + if (uploads == null) return emptyList() + return (0 until uploads.length()).mapNotNull { uploads.optJSONObject(it) } + .filter { it.optString("storage") != "external" } + .map { + ItchBuild( + it.optString("id"), ItchUploads.filename(it), ItchUploads.size(it), + it.optString("updated_at", it.optString("updatedAt")), ItchUploads.platforms(it), it.optBoolean("demo"), + ) + } + .sortedWith(compareByDescending { it.installable }.thenByDescending { it.updatedAt }) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchInstaller.kt b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchInstaller.kt index 96ec0ae353..5037de863c 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchInstaller.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchInstaller.kt @@ -38,11 +38,14 @@ internal class ItchInstaller( val key = ItchAuth.key(app) if (key.isBlank()) throw IllegalStateException(app.getString(R.string.stores_sync_sign_in)) val downloadKeyId = item.extra["downloadKeyId"].orEmpty() - if (downloadKeyId.isBlank()) throw IllegalStateException(app.getString(R.string.stores_itch_not_owned)) - val gameId = item.extra["gameId"].orEmpty().ifBlank { item.id.substringAfterLast('/') } + if (downloadKeyId.isBlank() && !item.isFree) throw IllegalStateException(app.getString(R.string.stores_itch_not_owned)) + val gameId = ItchGame.resolveId(item) ?: throw IllegalStateException(app.getString(R.string.stores_itch_no_game)) + val resuming = StoreGameSidecar.read(folder)?.let { it.state == StoreGameSidecar.STATE_INSTALLING && it.id == item.id } == true StoreInstalls.begin(folder, Store.ITCH, item.id, item.title, item.imageUrl, item.imageUrl) handle.stage(DownloadStage.MANIFEST) - val upload = ItchUploads.windows(ItchApi.uploads(key, gameId, downloadKeyId)) + val uploads = ItchApi.uploads(key, gameId, downloadKeyId) + val chosen = item.extra["uploadId"].orEmpty() + val upload = (if (chosen.isBlank()) ItchUploads.windows(uploads) else ItchUploads.byId(uploads, chosen)) ?: throw IllegalStateException(app.getString(R.string.stores_itch_no_upload)) val uploadId = upload.optString("id") val filename = ItchUploads.filename(upload) @@ -55,7 +58,7 @@ internal class ItchInstaller( download(key, downloadKeyId, uploadId, upload.optString("updated_at", upload.optString("updatedAt")), archive, size, handle) if (cancelled.get()) return null handle.stage(DownloadStage.INSTALL) - install(archive, filename, handle) + install(archive, filename, handle, resuming) } catch (t: Throwable) { if (!cancelled.get()) StoreInstalls.discard(app, folder, listOf(scratch)) throw t @@ -147,8 +150,16 @@ internal class ItchInstaller( } } - private fun install(archive: File, filename: String, handle: DownloadQueue.JobHandle): String? { + private fun clearPartialInstall() { + folder.listFiles()?.forEach { + if (it.name == StoreGameSidecar.FILE_NAME) return@forEach + if (it.isDirectory) StoreInstalls.deleteTree(it) else it.delete() + } + } + + private fun install(archive: File, filename: String, handle: DownloadQueue.JobHandle, resuming: Boolean): String? { folder.mkdirs() + if (resuming) clearPartialInstall() when (val kind = sniff(archive, filename)) { "zip" -> unzip(archive, handle) "7z" -> sevenZip(archive, handle) diff --git a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchUploads.kt b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchUploads.kt index 773ad22c30..7e3ed94b47 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchUploads.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/itch/ItchUploads.kt @@ -30,6 +30,28 @@ internal object ItchUploads { return names.none { it in PLATFORM_TRAITS } } + fun platforms(upload: JSONObject): Set { + val found = LinkedHashSet() + upload.optJSONObject("platforms")?.let { flags -> + for (name in listOf("windows", "linux", "osx", "android")) if (flags.optBoolean(name)) found.add(name) + } + upload.optJSONArray("traits")?.let { traits -> + for (i in 0 until traits.length()) when (traits.optString(i)) { + "p_windows" -> found.add("windows") + "p_linux" -> found.add("linux") + "p_osx" -> found.add("osx") + "p_android" -> found.add("android") + } + } + if (upload.optString("type") == "html") found.add("web") + return if (found.isEmpty()) setOf("windows") else found + } + + fun byId(uploads: JSONArray?, id: String): JSONObject? { + if (uploads == null || id.isBlank()) return null + return (0 until uploads.length()).mapNotNull { uploads.optJSONObject(it) }.firstOrNull { it.optString("id") == id } + } + fun size(upload: JSONObject): Long = upload.optLong("size", upload.optLong("size_bytes")) fun filename(upload: JSONObject): String = upload.optString("filename").substringAfterLast('/') diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt index 41e18b486e..97e289912f 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt @@ -561,6 +561,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com FlightsLayer(screenAt) GamesDialogs(a, s.steamGames) com.droiddeck.launcher.stores.StoresState.pendingInstall?.let { item -> StoreTheme(item.store) { InstallWhere(item) } } + com.droiddeck.launcher.stores.StoresState.itchPicking?.let { item -> StoreTheme(item.store) { ItchBuildPicker(item) { com.droiddeck.launcher.stores.StoresState.itchPicking = null } } } StepsLayer(screenAt) appToChooseDisplay?.let { app -> diff --git a/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt b/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt index 50b85c7e35..0024075286 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt @@ -397,6 +397,10 @@ private fun GameActions( } if (!item.accessible) SecondaryButton(buyLabel(item)) { openStoreUrl(ctx, item) } } + item != null && item.store == Store.ITCH && item.isFree -> { + InstallButton(stringResource(R.string.stores_install), leadOn) { StoresState.requestInstall(ctx, item) } + SecondaryButton(stringResource(R.string.stores_view_on, item.store.shortLabel)) { openStoreUrl(ctx, item) } + } item != null && item.isFree -> PrimaryButton(stringResource(R.string.stores_get_free), main = true, modifier = leadOn) { openStoreUrl(ctx, item) } item != null -> PrimaryButton(buyLabel(item), main = true, modifier = leadOn) { openStoreUrl(ctx, item) } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/ItchBuildPicker.kt b/app/src/main/java/com/droiddeck/launcher/ui/ItchBuildPicker.kt new file mode 100644 index 0000000000..09c6d08f32 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/ItchBuildPicker.kt @@ -0,0 +1,117 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.LinearProgressIndicator +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.key +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.StoresState +import com.droiddeck.launcher.stores.formatBytes +import com.droiddeck.launcher.stores.itch.ItchApi +import com.droiddeck.launcher.stores.itch.ItchAuth +import com.droiddeck.launcher.stores.itch.ItchBuild +import com.droiddeck.launcher.stores.itch.ItchGame +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +private class BuildList(val gameId: String, val builds: List) + +@Composable +internal fun ItchBuildPicker(item: CatalogItem, onDismiss: () -> Unit) { + val ctx = LocalContext.current + val app = ctx.applicationContext + val colors = MaterialTheme.colorScheme + val shown = rememberShown(onDismiss) + val close = { shown.targetState = false } + var loaded by remember(item) { mutableStateOf(null) } + var failed by remember(item) { mutableStateOf(false) } + + val install: (BuildList, ItchBuild) -> Unit = install@{ list, build -> + if (!shown.targetState) return@install + val tagged = item.copy( + extra = item.extra + mapOf("gameId" to list.gameId, "uploadId" to build.uploadId), + sizeBytes = build.size.takeIf { it > 0 } ?: item.sizeBytes, + ) + close() + StoresState.requestInstall(ctx, tagged) + } + + LaunchedEffect(item) { + val result = withContext(Dispatchers.IO) { + val key = ItchAuth.key(app) + val id = if (key.isBlank()) null else ItchGame.resolveId(item) + val uploads = id?.let { ItchApi.uploads(key, it, item.extra["downloadKeyId"].orEmpty()) } + if (id == null || uploads == null) null else BuildList(id, ItchGame.builds(uploads)) + } + if (result == null) { failed = true; return@LaunchedEffect } + loaded = result + if (shown.targetState) result.builds.singleOrNull()?.takeIf { it.installable }?.let { install(result, it) } + } + + AppDialog(shown, close, "itchBuilds", wide = false, maxWidth = 460.dp) { + DialogTitleRow(stringResource(R.string.stores_itch_pick_title), close) + Text(item.title, fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) + val list = loaded + when { + failed -> Text(stringResource(R.string.stores_itch_pick_failed), fontSize = 13.sp, color = colors.onSurfaceVariant) + list == null -> LinearProgressIndicator(Modifier.fillMaxWidth().padding(vertical = 8.dp)) + list.builds.isEmpty() -> Text(stringResource(R.string.stores_itch_pick_none), fontSize = 13.sp, color = colors.onSurfaceVariant) + else -> Column(verticalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth()) { + for (build in list.builds) key(build.uploadId) { BuildRow(item, build) { install(list, build) } } + } + } + } +} + +@Composable +private fun BuildRow(item: CatalogItem, build: ItchBuild, onInstall: () -> Unit) { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + val linux = "linux" in build.platforms && !build.installable + val detail = listOfNotNull( + build.platforms.map { platformName(it) }.joinToString(", "), + build.size.takeIf { it > 0 }?.let { formatBytes(it) }, + build.updatedAt.take(10).takeIf { it.isNotBlank() }, + if (build.demo) stringResource(R.string.stores_itch_build_demo) else null, + ).joinToString(" · ") + ListRow(enabled = !linux, onClick = { if (build.installable) onInstall() else openStoreUrl(ctx, item) }) { + Column(Modifier.weight(1f)) { + Text(build.filename.ifBlank { item.title }, fontSize = 13.sp, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text(detail, fontSize = 11.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) + } + val label = when { + build.installable -> stringResource(R.string.stores_install) + linux -> stringResource(R.string.stores_itch_build_linux_soon) + else -> stringResource(R.string.stores_itch_build_open) + } + Text(label, fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1) + } +} + +@Composable +private fun platformName(platform: String): String = stringResource( + when (platform) { + "windows" -> R.string.stores_itch_build_windows + "linux" -> R.string.stores_itch_build_linux + "osx" -> R.string.stores_itch_build_macos + "android" -> R.string.stores_itch_build_android + else -> R.string.stores_itch_build_web + }, +) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index d457db27a3..b609d1b918 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -2099,6 +2099,13 @@ تعذّر تحميل الألعاب من itch.io أرشيفات %1$s غير مدعومة استجاب itch.io بـ HTTP %1$d + اختر إصدارًا + لم يُعثر على تنزيلات لهذه اللعبة + تعذر تحميل التنزيلات من itch.io + نسخة تجريبية + فتح على itch.io + غير مدعوم بعد + تعذر العثور على هذه اللعبة على itch.io مجاني استئناف تحديث diff --git a/app/src/main/res/values-b+es+419/strings.xml b/app/src/main/res/values-b+es+419/strings.xml index 598c110e21..cd331b35fb 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -2783,6 +2783,13 @@ No se pudieron cargar los juegos de itch.io Los archivos %1$s no son compatibles itch.io respondió HTTP %1$d + Elige una versión + No se encontraron descargas para este juego + No se pudieron cargar las descargas de itch.io + Demo + Abrir en itch.io + Aún no es compatible + No se encontró este juego en itch.io Cámaras Luma Ultra — Experimental Seguimiento de posición de los Joy-Con Usa las cámaras de las gafas inteligentes para posicionar tus mandos Joy-Con emparejados. La rotación y las pulsaciones de los botones provienen de los mandos Joy-Con. La posición se estima cuando tus muñecas están ocultas. Reemplaza los mandos operados con las manos desnudas y pausa el seguimiento de la cámara del teléfono. Apunta los mandos Joy-Con hacia adelante al conectar o restablecer el centro de seguimiento. diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index a0bc668c8a..0f95de2328 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -2015,6 +2015,13 @@ Игрите от itch.io не можаха да се заредят Архивите %1$s не се поддържат itch.io отговори HTTP %1$d + Изберете версия + Не са намерени изтегляния за тази игра + Изтеглянията от itch.io не можаха да се заредят + Демо + Отваряне в itch.io + Все още не се поддържа + Играта не беше намерена в itch.io Безплатна Продължи Обнови diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 8880695bb6..b1977d00a5 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -2057,6 +2057,13 @@ Hry z itch.io se nepodařilo načíst Archivy %1$s nejsou podporovány itch.io odpovědělo HTTP %1$d + Vyberte verzi + Pro tuto hru nebyla nalezena žádná stažení + Stahování z itch.io se nepodařilo načíst + Demo + Otevřít na itch.io + Zatím nepodporováno + Tuto hru se na itch.io nepodařilo najít Zdarma Pokračovat Obnovit diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 853328bfd2..8786ddbedd 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -2015,6 +2015,13 @@ Kunne ikke hente spil fra itch.io %1$s-arkiver understøttes ikke itch.io svarede HTTP %1$d + Vælg en version + Ingen downloads fundet til dette spil + Kunne ikke indlæse downloads fra itch.io + Demo + Åbn på itch.io + Understøttes ikke endnu + Kunne ikke finde dette spil på itch.io Gratis Genoptag Opdater diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index db7241eaf3..dab2d35b29 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -2007,6 +2007,13 @@ Spiele von itch.io konnten nicht geladen werden %1$s-Archive werden nicht unterstützt itch.io antwortete mit HTTP %1$d + Version auswählen + Für dieses Spiel wurden keine Downloads gefunden + Die Downloads von itch.io konnten nicht geladen werden + Demo + Auf itch.io öffnen + Noch nicht unterstützt + Dieses Spiel wurde auf itch.io nicht gefunden Kostenlos Fortsetzen Aktualisieren diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index f720eba4f9..72ac7955ea 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -2015,6 +2015,13 @@ Δεν ήταν δυνατή η φόρτωση παιχνιδιών από το itch.io Τα αρχεία %1$s δεν υποστηρίζονται Το itch.io απάντησε HTTP %1$d + Επιλέξτε έκδοση + Δεν βρέθηκαν λήψεις για αυτό το παιχνίδι + Δεν ήταν δυνατή η φόρτωση των λήψεων από το itch.io + Demo + Άνοιγμα στο itch.io + Δεν υποστηρίζεται ακόμη + Δεν βρέθηκε αυτό το παιχνίδι στο itch.io Δωρεάν Συνέχιση Ανανέωση diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 118be6cee0..995e969e5f 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -2038,6 +2038,13 @@ No se pudieron cargar los juegos de itch.io Los archivos %1$s no son compatibles itch.io respondió HTTP %1$d + Elige una versión + No se han encontrado descargas para este juego + No se pudieron cargar las descargas de itch.io + Demo + Abrir en itch.io + Aún no es compatible + No se ha encontrado este juego en itch.io Gratis Reanudar Actualizar diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index f94c35c110..1304b02ac3 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -2015,6 +2015,13 @@ Pelien lataaminen itch.io:sta epäonnistui %1$s-arkistot eivät ole tuettuja itch.io vastasi HTTP %1$d + Valitse versio + Tälle pelille ei löytynyt latauksia + Latausten haku itch.iosta epäonnistui + Demo + Avaa itch.iossa + Ei vielä tuettu + Peliä ei löytynyt itch.iosta Ilmainen Jatka Päivitä diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 6b22a92a6e..325f41614c 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -2038,6 +2038,13 @@ Impossible de charger les jeux d\'itch.io Les archives %1$s ne sont pas prises en charge itch.io a répondu HTTP %1$d + Choisissez une version + Aucun téléchargement trouvé pour ce jeu + Impossible de charger les téléchargements depuis itch.io + Démo + Ouvrir sur itch.io + Pas encore pris en charge + Ce jeu est introuvable sur itch.io Gratuit Reprendre Actualiser diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index d0e385c612..7b0930217a 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -2015,6 +2015,13 @@ itch.io से गेम लोड नहीं हो सके %1$s आर्काइव समर्थित नहीं हैं itch.io ने HTTP %1$d लौटाया + संस्करण चुनें + इस गेम के लिए कोई डाउनलोड नहीं मिला + itch.io से डाउनलोड लोड नहीं हो सके + डेमो + itch.io पर खोलें + अभी समर्थित नहीं है + यह गेम itch.io पर नहीं मिला फ़्री फिर से शुरू करें रीफ़्रेश करें diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index ada8fe46c2..5fb0d0ee78 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -2015,6 +2015,13 @@ Nem sikerült betölteni a játékokat az itch.io-ról A(z) %1$s archívumok nem támogatottak Az itch.io HTTP %1$d választ adott + Válassz verziót + Ehhez a játékhoz nem található letöltés + A letöltések betöltése az itch.io-ról nem sikerült + Demó + Megnyitás az itch.io-n + Még nem támogatott + A játék nem található az itch.io-n Ingyenes Folytatás Frissítés diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 7a93dff316..1a2840c0c3 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -1994,6 +1994,13 @@ Tidak dapat memuat game dari itch.io Arsip %1$s tidak didukung itch.io menjawab HTTP %1$d + Pilih versi + Tidak ada unduhan untuk game ini + Tidak dapat memuat unduhan dari itch.io + Demo + Buka di itch.io + Belum didukung + Game ini tidak ditemukan di itch.io Gratis Lanjutkan Segarkan diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 5491ea5244..ffaf3f6027 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -2028,6 +2028,13 @@ Impossibile caricare i giochi da itch.io Gli archivi %1$s non sono supportati itch.io ha risposto HTTP %1$d + Scegli una versione + Nessun download trovato per questo gioco + Impossibile caricare i download da itch.io + Demo + Apri su itch.io + Non ancora supportato + Gioco non trovato su itch.io Gratis Riprendi Aggiorna diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index f0df57bd02..857969d089 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -1996,6 +1996,13 @@ itch.io のゲームを読み込めませんでした %1$s 形式のアーカイブには対応していません itch.io が HTTP %1$d を返しました + バージョンを選択 + このゲームのダウンロードが見つかりません + itch.io からダウンロードを読み込めませんでした + デモ + itch.io で開く + まだ対応していません + itch.io でこのゲームが見つかりませんでした 無料 再開 更新 diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 94e23ea9dd..64a063461a 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -1996,6 +1996,13 @@ itch.io에서 게임을 불러오지 못했습니다 %1$s 압축 파일은 지원하지 않습니다 itch.io가 HTTP %1$d을(를) 반환했습니다 + 버전 선택 + 이 게임의 다운로드를 찾을 수 없습니다 + itch.io에서 다운로드를 불러오지 못했습니다 + 데모 + itch.io에서 열기 + 아직 지원되지 않음 + itch.io에서 이 게임을 찾을 수 없습니다 무료 재개 새로 고침 diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index 9ba680d285..3135c66816 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -1994,6 +1994,13 @@ Tidak dapat memuatkan permainan daripada itch.io Arkib %1$s tidak disokong itch.io menjawab HTTP %1$d + Pilih versi + Tiada muat turun ditemui untuk permainan ini + Tidak dapat memuatkan muat turun daripada itch.io + Demo + Buka di itch.io + Belum disokong + Permainan ini tidak ditemui di itch.io Percuma Sambung Segar semula diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index cd62ccb5ac..4e685d919e 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -2015,6 +2015,13 @@ Kunne ikke laste spill fra itch.io %1$s-arkiver støttes ikke itch.io svarte HTTP %1$d + Velg en versjon + Fant ingen nedlastinger for dette spillet + Kunne ikke laste inn nedlastingene fra itch.io + Demo + Åpne på itch.io + Støttes ikke ennå + Fant ikke dette spillet på itch.io Gratis Gjenoppta Oppdater diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index c83f80dff1..30494a6fa5 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -2015,6 +2015,13 @@ Games van itch.io konden niet worden geladen %1$s-archieven worden niet ondersteund itch.io antwoordde HTTP %1$d + Kies een versie + Geen downloads gevonden voor deze game + De downloads van itch.io konden niet worden geladen + Demo + Openen op itch.io + Nog niet ondersteund + Deze game is niet gevonden op itch.io Gratis Hervatten Vernieuwen diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index f1234702a1..64414194eb 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -2057,6 +2057,13 @@ Nie udało się wczytać gier z itch.io Archiwa %1$s nie są obsługiwane itch.io odpowiedziało HTTP %1$d + Wybierz wersję + Nie znaleziono plików do pobrania dla tej gry + Nie udało się wczytać plików z itch.io + Demo + Otwórz w itch.io + Jeszcze nieobsługiwane + Nie znaleziono tej gry w itch.io Bezpłatna Wznów Odśwież diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 662a45b790..6900b72d55 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -2028,6 +2028,13 @@ Não foi possível carregar os jogos do itch.io Ficheiros %1$s não são suportados O itch.io respondeu HTTP %1$d + Escolha uma versão + Não foram encontradas transferências para este jogo + Não foi possível carregar as transferências do itch.io + Demo + Abrir no itch.io + Ainda não suportado + Não foi possível encontrar este jogo no itch.io Grátis Retomar Atualizar diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index c0c4ca359e..a03f518c5e 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -2028,6 +2028,13 @@ Não foi possível carregar os jogos do itch.io Arquivos %1$s não são suportados O itch.io respondeu HTTP %1$d + Escolha uma versão + Nenhum download encontrado para este jogo + Não foi possível carregar os downloads do itch.io + Demo + Abrir no itch.io + Ainda não suportado + Não foi possível encontrar este jogo no itch.io Grátis Retomar Atualizar diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 9bd9a1df3a..e1e54f3515 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -2036,6 +2036,13 @@ Nu s-au putut încărca jocurile de pe itch.io Arhivele %1$s nu sunt acceptate itch.io a răspuns HTTP %1$d + Alege o versiune + Nu s-au găsit descărcări pentru acest joc + Descărcările de pe itch.io nu au putut fi încărcate + Demo + Deschide pe itch.io + Încă nu este acceptat + Jocul nu a fost găsit pe itch.io Gratuit Reluare Reîmprospătează diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 7fa1bc8a6b..0c45e5b870 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -2059,6 +2059,13 @@ Не удалось загрузить игры с itch.io Архивы %1$s не поддерживаются itch.io ответил HTTP %1$d + Выберите версию + Для этой игры не найдено загрузок + Не удалось загрузить список файлов с itch.io + Демо + Открыть на itch.io + Пока не поддерживается + Не удалось найти эту игру на itch.io Бесплатно Продолжить Обновить diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 1729070d38..59169120f8 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -2015,6 +2015,13 @@ Det gick inte att läsa in spel från itch.io %1$s-arkiv stöds inte itch.io svarade HTTP %1$d + Välj en version + Inga nedladdningar hittades för det här spelet + Det gick inte att läsa in nedladdningarna från itch.io + Demo + Öppna på itch.io + Stöds inte ännu + Spelet hittades inte på itch.io Gratis Återuppta Uppdatera diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 3fca7f7dd1..f300fe8964 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -1994,6 +1994,13 @@ โหลดเกมจาก itch.io ไม่ได้ ไม่รองรับไฟล์ %1$s itch.io ตอบกลับ HTTP %1$d + เลือกเวอร์ชัน + ไม่พบไฟล์ดาวน์โหลดสำหรับเกมนี้ + โหลดรายการดาวน์โหลดจาก itch.io ไม่ได้ + เดโม + เปิดบน itch.io + ยังไม่รองรับ + ไม่พบเกมนี้บน itch.io ฟรี ดำเนินการต่อ รีเฟรช diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 9b917e2339..a8347b5c64 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -2009,6 +2009,13 @@ itch.io oyunları yüklenemedi %1$s arşivleri desteklenmiyor itch.io HTTP %1$d yanıtı verdi + Bir sürüm seçin + Bu oyun için indirme bulunamadı + İndirmeler itch.io\'dan yüklenemedi + Demo + itch.io\'da aç + Henüz desteklenmiyor + Bu oyun itch.io\'da bulunamadı Ücretsiz Sürdür Yenile diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 8b55100f67..bc35a13b61 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -2057,6 +2057,13 @@ Не вдалося завантажити ігри з itch.io Архіви %1$s не підтримуються itch.io відповів HTTP %1$d + Виберіть версію + Для цієї гри не знайдено завантажень + Не вдалося завантажити список файлів з itch.io + Демо + Відкрити на itch.io + Ще не підтримується + Не вдалося знайти цю гру на itch.io Безкоштовно Продовжити Оновити diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 0bde8b4a9f..aa8132f50e 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -1994,6 +1994,13 @@ Không tải được game từ itch.io Không hỗ trợ tệp %1$s itch.io trả về HTTP %1$d + Chọn phiên bản + Không tìm thấy bản tải xuống cho trò chơi này + Không thể tải danh sách tải xuống từ itch.io + Bản demo + Mở trên itch.io + Chưa được hỗ trợ + Không tìm thấy trò chơi này trên itch.io Miễn phí Tiếp tục Làm mới diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 3004e5b178..0d4cdd5b58 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -2074,6 +2074,13 @@ 无法从 itch.io 加载游戏 不支持 %1$s 压缩包 itch.io 返回 HTTP %1$d + 选择版本 + 未找到此游戏的下载 + 无法从 itch.io 加载下载内容 + 试玩版 + 在 itch.io 上打开 + 暂不支持 + 在 itch.io 上找不到这款游戏 免费 继续 刷新 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 82daf9cca2..50a1a5011d 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -1997,6 +1997,13 @@ 無法從 itch.io 載入遊戲 不支援 %1$s 壓縮檔 itch.io 回應 HTTP %1$d + 選擇版本 + 找不到此遊戲的下載 + 無法從 itch.io 載入下載內容 + 試玩版 + 在 itch.io 開啟 + 暫不支援 + 在 itch.io 找不到這款遊戲 免費 繼續 重新整理 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 26d108539b..d3f66e5024 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1997,6 +1997,13 @@ 無法從 itch.io 載入遊戲 不支援 %1$s 壓縮檔 itch.io 回應 HTTP %1$d + 選擇版本 + 找不到此遊戲的下載 + 無法從 itch.io 載入下載內容 + 試玩版 + 在 itch.io 開啟 + 尚未支援 + 在 itch.io 找不到這款遊戲 免費 繼續 重新整理 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 11dc9fd569..1044953c7b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2108,6 +2108,18 @@ Could not load games from itch.io %1$s archives are not supported itch.io answered HTTP %1$d + Choose a version + No downloads found for this game + Could not load the downloads from itch.io + Demo + Open on itch.io + Not supported yet + Could not find this game on itch.io + Windows + macOS + Linux + Android + Web Free Resume Refresh diff --git a/app/src/test/java/com/droiddeck/launcher/stores/itch/ItchGameTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/itch/ItchGameTest.kt new file mode 100644 index 0000000000..1b7d8336f7 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/stores/itch/ItchGameTest.kt @@ -0,0 +1,66 @@ +package com.droiddeck.launcher.stores.itch + +import org.json.JSONArray +import org.json.JSONObject +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test + +@org.junit.runner.RunWith(org.robolectric.RobolectricTestRunner::class) +@org.robolectric.annotation.Config(sdk = [33], application = android.app.Application::class) +class ItchGameTest { + private fun upload(id: String, filename: String, vararg traits: String, type: String = "default", storage: String = "hosted", demo: Boolean = false, updated: String = "2026-09-16T02:26:06Z") = + JSONObject().put("id", id).put("filename", filename).put("size", 1000).put("type", type).put("storage", storage) + .put("demo", demo).put("traits", JSONArray(traits.toList())).put("updated_at", updated) + + @Test fun theGameNumberComesFromThePageMeta() { + assertEquals("1576684", ItchGame.idFromPage("""""")) + assertEquals("1576684", ItchGame.idFromPage("""""")) + assertNull(ItchGame.idFromPage("no meta here")) + } + + @Test fun platformsComeFromTheTraits() { + assertEquals(setOf("windows"), ItchUploads.platforms(upload("1", "a.zip", "p_windows"))) + assertEquals(setOf("linux", "osx"), ItchUploads.platforms(upload("2", "a.zip", "p_linux", "p_osx"))) + assertEquals(setOf("android"), ItchUploads.platforms(upload("3", "a.apk", "p_android"))) + assertEquals(setOf("web"), ItchUploads.platforms(upload("4", "a.zip", type = "html"))) + } + + @Test fun anUploadWithNoPlatformIsTreatedAsWindows() { + assertEquals(setOf("windows"), ItchUploads.platforms(upload("5", "a.zip"))) + } + + @Test fun platformsAlsoReadTheFlagObject() { + val flags = JSONObject().put("windows", false).put("linux", true) + assertEquals(setOf("linux"), ItchUploads.platforms(JSONObject().put("platforms", flags))) + } + + @Test fun buildsSkipExternalUploadsAndPutWindowsFirst() { + val uploads = JSONArray() + .put(upload("10", "linux.tar.gz", "p_linux", updated = "2026-10-01T00:00:00Z")) + .put(upload("11", "win.zip", "p_windows", updated = "2026-09-01T00:00:00Z")) + .put(upload("12", "site", "p_windows", storage = "external")) + val builds = ItchGame.builds(uploads) + assertEquals(listOf("11", "10"), builds.map { it.uploadId }) + assertTrue(builds[0].installable) + assertFalse(builds[1].installable) + } + + @Test fun aDemoIsFlagged() { + assertTrue(ItchGame.builds(JSONArray().put(upload("20", "demo.zip", "p_windows", demo = true))).single().demo) + } + + @Test fun anUploadIsFoundById() { + val uploads = JSONArray().put(upload("30", "a.zip")).put(upload("31", "b.zip")) + assertEquals("b.zip", ItchUploads.byId(uploads, "31")?.optString("filename")) + assertNull(ItchUploads.byId(uploads, "99")) + assertNull(ItchUploads.byId(uploads, "")) + } + + @Test fun noDownloadKeyMeansNoKeyInTheAddress() { + assertEquals("https://api.itch.io/uploads/13619666/download", ItchApi.downloadUrl("13619666", "")) + assertEquals("https://api.itch.io/uploads/13619666/download?download_key_id=7", ItchApi.downloadUrl("13619666", "7")) + } +} diff --git a/docs/development/itch-install.md b/docs/development/itch-install.md new file mode 100644 index 0000000000..3db9fde5d4 --- /dev/null +++ b/docs/development/itch-install.md @@ -0,0 +1,21 @@ +# itch.io install and version picker + +Installing an itch.io game opens a version picker first. It lists the game's uploads from `/games/{id}/uploads`, with the platform, size and date of each. + +- Windows builds install. A game with a single Windows build skips the picker and installs at once. +- Other builds (macOS, Android, web) open the game's page on itch.io. +- Linux builds are listed but cannot be installed yet. + +## Free games + +A free game does not need to be in the library. The game's number is read from the `itch:path` meta tag of its page (`games/`), and both the upload list and the download work with the API key alone and no download key. This was checked against a live free game: the upload list answered 200 and a one-byte range request on the download answered 206. + +A game that costs money and has no download key in the library is still refused. + +## Pieces + +`ItchGame` finds the game number and turns the upload list into builds. `ItchUploads.platforms` reads the platform from the upload's flags or `p_*` traits, and treats an upload with none as Windows. `ItchBuildPicker` is the pop-up. The chosen upload is carried in the item's `extra` as `uploadId`, and `ItchInstaller` downloads that upload. + +If the upload the user chose is no longer in the game's list when the install starts, the install fails with "No Windows download for this game" and does not pick another build. Only an install with no chosen upload falls back to the newest Windows build. The saved queue keeps whether a game is free, so an interrupted free-game install resumes after a restart. + +Before an install extracts, a leftover partial install of the same game (a folder whose marker said "installing" with this game's ID when the install started) is emptied, so a different build chosen after an interruption never mixes with files from the first. A finished or updating install, or another game's unfinished folder that happens to share the folder name, is never emptied.