Move update source to Gitea (git.beckm4nn.net)
Some checks failed
Build TV app / build (push) Failing after 3s
Some checks failed
Build TV app / build (push) Failing after 3s
Releases API for the version check; the APK itself is served from the orphan 'apk' branch of the public repo (asset uploads need a token, raw files do not). Transitional GitHub release carries this change so existing installs hop over. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,8 +12,8 @@ android {
|
||||
applicationId = "dev.castarr.tv"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 18
|
||||
versionName = "0.8.2"
|
||||
versionCode = 19
|
||||
versionName = "0.8.3"
|
||||
}
|
||||
|
||||
// Release signing from environment (see ~/.keys/castarr-release.env on the
|
||||
|
||||
@@ -126,14 +126,12 @@ class DispatcharrRepository(context: Context, private val auth: DeviceAuth) {
|
||||
name = obj.optString("effective_name").ifEmpty { obj.optString("name") },
|
||||
url = streamUrl(uuid),
|
||||
group = groups[obj.optInt("channel_group_id")].orEmpty(),
|
||||
// logo-cache endpoint is AllowAny — loads without auth.
|
||||
logo = obj.optJSONObject("logo")?.optString("cache_url").orEmpty().let {
|
||||
when {
|
||||
it.isEmpty() || it == "null" -> ""
|
||||
it.startsWith("http") -> it
|
||||
else -> auth.serverUrl.trimEnd('/') + it
|
||||
}
|
||||
},
|
||||
// The list serializer only carries logo ids; the
|
||||
// cache endpoint serves the image without auth.
|
||||
logo = (obj.optInt("effective_logo_id").takeIf { it > 0 }
|
||||
?: obj.optInt("logo_id").takeIf { it > 0 })
|
||||
?.let { "${auth.serverUrl.trimEnd('/')}/api/channels/logos/$it/cache/" }
|
||||
.orEmpty(),
|
||||
tvgId = obj.optString("effective_tvg_id").ifEmpty { obj.optString("tvg_id") },
|
||||
backendId = id,
|
||||
streamKey = uuid,
|
||||
|
||||
@@ -13,11 +13,17 @@ import java.io.File
|
||||
import java.net.HttpURLConnection
|
||||
import java.net.URL
|
||||
|
||||
/** In-app updater over GitHub releases (#12). Explicit, never automatic. */
|
||||
/** In-app updater over Gitea releases (#12). Explicit, never automatic. */
|
||||
object UpdateChecker {
|
||||
|
||||
private const val TAG = "UpdateChecker"
|
||||
private const val LATEST = "https://api.github.com/repos/be-nj/castarr/releases/latest"
|
||||
private const val LATEST =
|
||||
"https://git.beckm4nn.net/api/v1/repos/benjamin/castarr/releases/latest"
|
||||
|
||||
// Release assets need an API token to upload, so the APK is served from
|
||||
// an orphan branch instead — anonymously fetchable on a public repo.
|
||||
private const val APK_FALLBACK =
|
||||
"https://git.beckm4nn.net/benjamin/castarr/raw/branch/apk/castarr.apk"
|
||||
|
||||
private var apkUrl: String = ""
|
||||
|
||||
@@ -35,6 +41,7 @@ object UpdateChecker {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (url.isEmpty() && tag.isNotEmpty()) url = APK_FALLBACK
|
||||
if (url.isNotEmpty() && isNewer(tag, BuildConfig.VERSION_NAME)) {
|
||||
apkUrl = url
|
||||
val version = "v$tag"
|
||||
|
||||
Reference in New Issue
Block a user