From c8f40f097269c34da58b64bef469d3815ebc2147 Mon Sep 17 00:00:00 2001 From: Pauljd Date: Sun, 15 Nov 2026 20:02:45 +0000 Subject: [PATCH] A re-filed film plays where the schedule keeps its old number: the Drive-In and Catch Up (1.0 RC3-11, build 53) Paul, 15 November 2026: the Drive-In stayed on tuning at 20:00. Its film had a new number after the rescan; Orbit found it in 3 seconds and had it ready, but the screen only shows a prepared programme whose ID matches the booked one, and the Drive-In's schedule (like Catch Up) isn't rewritten with the new copy. The prepared plan now remembers which booked programme it's for. Co-Authored-By: Claude Opus 5.5 --- android/app/build.gradle.kts | 2 +- .../main/java/tv/orbit/classic/SampleChannelScreens.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index c1792d5c..241cf4a3 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id("org.jetbrains.kotlin.plugin.compose") } /** The release's build number: versionCode is this x 10 plus the edition's channel. */ -val ORBIT_BUILD = 52 +val ORBIT_BUILD = 53 android { namespace = "tv.orbit.classic" compileSdk = 36 diff --git a/android/app/src/main/java/tv/orbit/classic/SampleChannelScreens.kt b/android/app/src/main/java/tv/orbit/classic/SampleChannelScreens.kt index b480124a..09e01bab 100644 --- a/android/app/src/main/java/tv/orbit/classic/SampleChannelScreens.kt +++ b/android/app/src/main/java/tv/orbit/classic/SampleChannelScreens.kt @@ -122,6 +122,10 @@ internal fun ScheduledChannelPlayer(session: EmbySampleSession, channel: SampleC val handedNow = handed?.takeIf { it.available && it.channelNumber == channel.number } var prepared by remember(channel) { mutableStateOf(handedNow?.plan) } var preparedSlot by remember(channel) { mutableStateOf(handedNow?.startMs) } + // The booked programme a prepared plan is for. A re-filed copy has a new ID of its own (openBooked), and where the schedule + // isn't updated with it (the Drive-In, Catch Up), matching on the plan's own ID never matched: the film was found and + // ready, and the screen stayed on tuning (Paul, 15 November 2026, the Drive-In at 20:00). + var preparedFor by remember(channel) { mutableStateOf(handedNow?.plan?.item?.id) } var problem by remember(channel) { mutableStateOf(null) } var retryAttempt by remember(channel) { mutableIntStateOf(0) } // Waiting on a slow server (1.0 RC3): after a few seconds the tuning screen says so; when it doesn't answer at all, Orbit @@ -159,7 +163,7 @@ internal fun ScheduledChannelPlayer(session: EmbySampleSession, channel: SampleC if (fit == RuntimeFit.Adjust && clockOffsetMs == 0L) plan.durationMs?.let { actual -> withContext(Dispatchers.IO) { PlanEdits.retime(channel, schedules, session.accountId, current.startMs, actual) } } - preparedSlot = current.startMs; prepared = plan + preparedSlot = current.startMs; preparedFor = current.media.item.id; prepared = plan } catch (cancelled: CancellationException) { throw cancelled } // The server not answering at all (13 November 2026: Emby froze for six minutes during its scan) isn't this programme's // fault: say so plainly, and try again by itself every 30 seconds rather than give the slot up. @@ -168,7 +172,7 @@ internal fun ScheduledChannelPlayer(session: EmbySampleSession, channel: SampleC catch (_: Exception) { problem = if (channel is ScheduledChannel) "This programme isn't available right now. Orbit moves on at ${clock(current.endMs)}." else "This scheduled programme could not be opened. Return to the guide and try again." } } // Suppress the preceding plan immediately at a boundary while the effect schedules its replacement. - val plan = loadedNow?.plan ?: prepared?.takeIf { it.item.id == current.media.item.id && preparedSlot == current.startMs && problem == null } + val plan = loadedNow?.plan ?: prepared?.takeIf { (it.item.id == current.media.item.id || preparedFor == current.media.item.id) && preparedSlot == current.startMs && problem == null } // The ident playing out, held on its last frame until the next programme's first picture is on screen. var heldIdent by remember(channel) { mutableStateOf(null) } // The block's ident chosen at the changeover, kept with the held ident so its length and overlay stay the same throughout.