A test that holds the Drive-In fix: the slot match moved into shownPlan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -172,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 || preparedFor == current.media.item.id) && preparedSlot == current.startMs && problem == null }
|
||||
val plan = loadedNow?.plan ?: shownPlan(prepared, preparedFor, preparedSlot, current, problem)
|
||||
// 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<SampleBroadcast?>(null) }
|
||||
// The block's ident chosen at the changeover, kept with the held ident so its length and overlay stay the same throughout.
|
||||
@@ -294,3 +294,11 @@ internal fun ClassicTuningNumber(number: Int, modifier: Modifier = Modifier) {
|
||||
style = androidx.compose.ui.text.TextStyle(shadow = androidx.compose.ui.graphics.Shadow(
|
||||
Color.Black, androidx.compose.ui.geometry.Offset(2f, 2f), 2f)))
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The prepared programme to show, if it's this slot's: the booked file itself, or a copy found again under a new number for
|
||||
* it (re-filed after a rescan, 15 November 2026), and only when nothing went wrong.
|
||||
*/
|
||||
internal fun shownPlan(prepared: EmbyPlaybackPlan?, preparedFor: String?, preparedSlot: Long?, current: SampleBroadcast, problem: String?): EmbyPlaybackPlan? =
|
||||
prepared?.takeIf { (it.item.id == current.media.item.id || preparedFor == current.media.item.id) && preparedSlot == current.startMs && problem == null }
|
||||
|
||||
@@ -146,3 +146,20 @@ class RecheckAfterRescanTest {
|
||||
} finally { dir.deleteRecursively() }
|
||||
}
|
||||
}
|
||||
|
||||
/** 15 November 2026: the Drive-In's film, found again under a new number, stayed on tuning because the screen matched on the old one. */
|
||||
class RefiledPlaysTest {
|
||||
private fun item(id: String) = SampleItem("Fixture Film", "Movie", 90, "", id, 90 * 60_000L)
|
||||
private fun plan(id: String) = EmbyPlaybackPlan(item(id), "https://media.example.test/$id.mkv", "src$id", "fixture-play", emptyList(), 90 * 60_000L)
|
||||
private val booked = SampleBroadcast(ScheduledMedia(item("old1"), "srcold1", 90 * 60_000L), 1_000L)
|
||||
|
||||
@Test fun aCopyFoundAgainPlaysInItsBookedSlot() {
|
||||
assertNotNull(shownPlan(plan("old1"), "old1", 1_000L, booked, null))
|
||||
// The re-filed copy, for the booked programme, in its slot: shown.
|
||||
assertNotNull(shownPlan(plan("new1"), "old1", 1_000L, booked, null))
|
||||
// Prepared for another programme, another slot, or with a problem: not shown.
|
||||
assertNull(shownPlan(plan("new1"), "other", 1_000L, booked, null))
|
||||
assertNull(shownPlan(plan("new1"), "old1", 2_000L, booked, null))
|
||||
assertNull(shownPlan(plan("new1"), "old1", 1_000L, booked, "This programme isn't available right now."))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -483,4 +483,4 @@ A top-up scan gave some booked films and episodes new numbers in Emby. Three fix
|
||||
- RC3-8: the first renumbered programme on a channel rechecks the channel's whole schedule in one go and re-files the rest.
|
||||
- RC3-8: tuning ahead stops asking for a programme the server says is gone.
|
||||
- RC3-11: a re-filed film plays where the schedule keeps its old number (the Drive-In, Catch Up); before, it was found and
|
||||
ready but the screen waited on tuning. To do: a test that holds this (the match is inside the screen's Compose code).
|
||||
ready but the screen waited on tuning. Held by RefiledPlaysTest (shownPlan).
|
||||
|
||||
Reference in New Issue
Block a user