Server changes/Sonarr

This commit is contained in:
ponzischeme89
2026-07-27 21:06:51 +12:00
parent 62f6345a40
commit 8d6cf2f5a1
42 changed files with 2388 additions and 284 deletions
+16 -5
View File
@@ -15,6 +15,18 @@ val embyServerUrl: String = (project.findProperty("memby.serverUrl") as String?)
// becomes a thin renderer; blank keeps the direct-to-Emby path above.
val membyGatewayUrl: String = (project.findProperty("memby.gatewayUrl") as String?).orEmpty().trim()
// A release workflow can derive the app version from its Git tag without editing the
// source tree. Local builds keep using the checked-in default.
val defaultVersionName = "0.1.54"
val membyVersionName: String =
(project.findProperty("memby.versionName") as String?)
?.trim()
?.takeIf { it.matches(Regex("""\d+\.\d+\.\d+""")) }
?: defaultVersionName
val membyVersionParts = membyVersionName.split('.').map(String::toInt)
val membyVersionCode =
membyVersionParts[0] * 10_000 + membyVersionParts[1] * 100 + membyVersionParts[2]
/** Reads a key from local.properties, which is gitignored and holds machine secrets. */
val localProperties = Properties().apply {
val file = rootProject.file("local.properties")
@@ -37,11 +49,10 @@ android {
applicationId = "com.ponzischeme89.memby"
minSdk = 23
targetSdk = 35
// versionCode is derived from versionName: major*10000 + minor*100 + patch.
// 0.1.53 -> 153. Keep them in step; the in-app updater compares versionName,
// but Android will not install an APK whose versionCode went backwards.
versionCode = 153
versionName = "0.1.53"
// Derived from one version string so CI cannot publish a versionName/versionCode
// pair that Android later refuses to install.
versionCode = membyVersionCode
versionName = membyVersionName
buildConfigField("String", "EMBY_SERVER_URL", "\"${embyServerUrl.replace("\"", "\\\"")}\"")
buildConfigField("String", "MEMBY_GATEWAY_URL", "\"${membyGatewayUrl.replace("\"", "\\\"")}\"")