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) <noreply@anthropic.com>
This commit is contained in:
2026-11-06 01:02:56 +00:00
co-authored by Claude Opus 5.5
parent 2b43178cfc
commit 99bf39cbeb
6 changed files with 24 additions and 4 deletions
+2 -2
View File
@@ -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 }
@@ -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)
@@ -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 = {
@@ -39,6 +39,10 @@ internal object PromoBoard {
var items by mutableStateOf<List<WhatsOnItem>>(emptyList())
/** When each channel last showed a promo. */
val shown = mutableMapOf<Int, Long>()
/** A promo shown on request from Settings, to see one without waiting. */
var preview by mutableStateOf<WhatsOnItem?>(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 }
}
/**
@@ -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()) {
@@ -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<String?>(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 })
}