From 99bf39cbeb0e06685c24d40bd2ab96f9e6f888d9 Mon Sep 17 00:00:00 2001 From: Pauljd Date: Fri, 6 Nov 2026 01:02:56 +0000 Subject: [PATCH] 0.108.38: see a promo now, from Settings Paul, 6 November 2026: Settings > Watching > Promos > Show one plays a promo for the first highlight ahead that the profile watching can see, as it plays between programmes, for about eight seconds. Co-Authored-By: Claude Opus 5.5 (1M context) --- android/app/build.gradle.kts | 4 ++-- android/app/src/main/java/tv/orbit/classic/EmbyClient.kt | 2 +- .../main/java/tv/orbit/classic/EmbyConnectionScreen.kt | 9 +++++++++ android/app/src/main/java/tv/orbit/classic/Promos.kt | 4 ++++ .../main/java/tv/orbit/classic/SecureMediaDataSource.kt | 2 +- android/app/src/main/java/tv/orbit/classic/Settings.kt | 7 +++++++ 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index d078bde2..ca04d244 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -9,8 +9,8 @@ android { applicationId = "tv.orbit.classic" minSdk = 26 targetSdk = 36 - versionCode = 197 - versionName = "0.108.37-promos" + versionCode = 198 + versionName = "0.108.38-promo-preview" } buildFeatures { compose = true } compileOptions { sourceCompatibility = JavaVersion.VERSION_17; targetCompatibility = JavaVersion.VERSION_17 } diff --git a/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt b/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt index 6a31cc81..cba1dafc 100644 --- a/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt +++ b/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt @@ -66,7 +66,7 @@ internal class HttpsEmbyTransport(internal val deviceId: String = UUID.randomUUI connection.connectTimeout = 10_000 connection.readTimeout = request.readTimeoutMs ?: if (request.path == "/Sessions/Logout") 5_000 else 15_000 connection.setRequestProperty("Accept", "application/json") - connection.setRequestProperty("X-Emby-Authorization", "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.37\"") + connection.setRequestProperty("X-Emby-Authorization", "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.38\"") request.token?.let { connection.setRequestProperty("X-Emby-Token", it) } if (request.method == "POST") { val bytes = request.body.orEmpty().toByteArray(Charsets.UTF_8) diff --git a/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt b/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt index 5bc14193..574cf983 100644 --- a/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt +++ b/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt @@ -366,6 +366,15 @@ internal fun EmbyConnectionScreen(modifier: Modifier = Modifier, visible: Boolea delay(5_000) } } + // A promo on request from Settings, as it plays between programmes, for about the length of an ident. + PromoBoard.preview?.let { item -> + val active = session + if (active == null) PromoBoard.preview = null + else androidx.compose.ui.window.Dialog(onDismissRequest = { PromoBoard.preview = null }, properties = androidx.compose.ui.window.DialogProperties(usePlatformDefaultWidth = false)) { + LaunchedEffect(item) { delay(8_000); PromoBoard.preview = null } + PromoOverlay(active, item) + } + } programmeReminder?.let { due -> fun answered() { saveReminders(reminders.map { if (it.channel == due.channel && it.startMs == due.startMs) it.copy(stage = due.stage) else it }); programmeReminder = null } ProgrammeReminderCard(due, System.currentTimeMillis(), onDismiss = ::answered, onWatch = { diff --git a/android/app/src/main/java/tv/orbit/classic/Promos.kt b/android/app/src/main/java/tv/orbit/classic/Promos.kt index e9a31d3e..2178eb9f 100644 --- a/android/app/src/main/java/tv/orbit/classic/Promos.kt +++ b/android/app/src/main/java/tv/orbit/classic/Promos.kt @@ -39,6 +39,10 @@ internal object PromoBoard { var items by mutableStateOf>(emptyList()) /** When each channel last showed a promo. */ val shown = mutableMapOf() + /** A promo shown on request from Settings, to see one without waiting. */ + var preview by mutableStateOf(null) + /** The highlight a preview shows: the first still ahead that the profile watching can see. */ + fun previewItem(nowMs: Long) = items.firstOrNull { it.startMs > nowMs && !lockedOut(it.channel) && !profileHides(it.channel) && it.driveIn?.let { b -> lockedOut(b) } != true } } /** diff --git a/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt b/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt index 3bed96d0..a15b2dc4 100644 --- a/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt +++ b/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt @@ -33,7 +33,7 @@ internal class SecureMediaDataSource(private val session: EmbySampleSession) : B next.instanceFollowRedirects = false next.connectTimeout = 10_000 next.readTimeout = 20_000 - next.setRequestProperty("User-Agent", "OrbitTV/0.108.37") + next.setRequestProperty("User-Agent", "OrbitTV/0.108.38") next.setRequestProperty("Accept-Encoding", "identity") session.mediaHeaders(address).forEach { (key, value) -> next.setRequestProperty(key, value) } if (dataSpec.position != 0L || dataSpec.length != C.LENGTH_UNSET.toLong()) { diff --git a/android/app/src/main/java/tv/orbit/classic/Settings.kt b/android/app/src/main/java/tv/orbit/classic/Settings.kt index d2b5a9b6..ca7d5ddf 100644 --- a/android/app/src/main/java/tv/orbit/classic/Settings.kt +++ b/android/app/src/main/java/tv/orbit/classic/Settings.kt @@ -230,6 +230,13 @@ private fun ViewingDetail(totsOn: Boolean, windingDown: Boolean, onWindDown: (Bo SettingLine("The cast", "Show Ollie, Zip, Blaze, Drift and Luna in the squeeze-back and promos.") { OrbitButton(if (castOn) "On" else "Off", Modifier.width(64.dp), selected = castOn, onClick = { castOn = !castOn; settings.castOn = castOn }) } + var promoNote by remember { mutableStateOf(null) } + SettingLine("Promos", promoNote ?: "Now and then a promo for tonight's highlights plays in place of a channel's ident. See one now; it closes by itself.") { + OrbitButton("Show one", onClick = { + val item = PromoBoard.previewItem(System.currentTimeMillis()) + if (item == null) promoNote = "Nothing coming up to promote yet. Try again in a few minutes." else { promoNote = null; PromoBoard.preview = item } + }) + } SettingLine("Drive-In curtains", "Play the curtain intro, with its fanfare, as you go into a screening. Back skips it.") { OrbitButton(if (driveInIntro) "On" else "Off", Modifier.width(64.dp), selected = driveInIntro, onClick = { driveInIntro = !driveInIntro; settings.driveInIntro = driveInIntro }) }