From de6fad41f6c9389083c035a69b5890bcaddd3892 Mon Sep 17 00:00:00 2001 From: qimiko <25387744+qimiko@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:38:11 -0700 Subject: [PATCH] fix nightly download url --- .../geode/launcher/updater/ReleaseRepository.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/geode/launcher/updater/ReleaseRepository.kt b/app/src/main/java/com/geode/launcher/updater/ReleaseRepository.kt index ac9ab30a..e5e945b1 100644 --- a/app/src/main/java/com/geode/launcher/updater/ReleaseRepository.kt +++ b/app/src/main/java/com/geode/launcher/updater/ReleaseRepository.kt @@ -17,9 +17,18 @@ class ReleaseRepository(private val httpClient: OkHttpClient) { private const val GITHUB_API_VERSION = "2022-11-28" } + suspend fun getLatestLauncherRelease(): Release? { + val releasePath = "$GITHUB_API_BASE/repos/geode-sdk/android-launcher/releases/latest" + + val url = URL(releasePath) + + return getReleaseByUrl(url) + } + suspend fun getLatestGeodeRelease(isNightly: Boolean = false): Release? { - val releasePath = if (isNightly) "$GITHUB_API_BASE/releases/tags/nightly" - else "$GITHUB_API_BASE/repos/geode-sdk/geode/releases/latest" + val geodeBaseUrl = "$GITHUB_API_BASE/repos/geode-sdk/geode/releases" + val releasePath = if (isNightly) "$geodeBaseUrl/tags/nightly" + else "$geodeBaseUrl/latest" val url = URL(releasePath) @@ -34,6 +43,8 @@ class ReleaseRepository(private val httpClient: OkHttpClient) { .addHeader(GITHUB_API_HEADER, GITHUB_API_VERSION) .build() + println("fetching url $url") + val call = httpClient.newCall(request) val response = call.executeCoroutine()