Premiere release check: what precedes each debut, What's On's time, and when the home channel first shows it
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 2m15s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m39s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-05 17:01:15 +00:00
co-authored by Claude Opus 5.5
parent 25e6d4f669
commit b0b3c8fba5
2 changed files with 17 additions and 0 deletions
@@ -92,6 +92,17 @@ class PremiereReplayTest {
val booked = with[PREMIERE_NUMBER].orEmpty().firstOrNull { it.why.startsWith(PREMIERE_WHY) && it.seriesId == d.film.itemId }
out.appendLine("${d.film.title}: approved ${at(debut)} on Orbit Premiere -> " +
if (booked == null) "NOT BOOKED" else "booked ${at(booked.startMs)} to ${at(booked.endMs)} (${(booked.startMs - debut) / 60_000} min late)")
if (booked != null) {
val plan301 = with[PREMIERE_NUMBER].orEmpty().sortedBy { it.startMs }
val before = plan301.lastOrNull { it.startMs < booked.startMs }
out.appendLine(" before it on Premiere: ${before?.let { "${it.media.item.title} ${at(it.startMs)} to ${at(it.endMs)}, ${if (it.endMs == booked.startMs) "ends exactly as the debut starts" else if (it.endMs > booked.startMs) "OVERLAPS" else "ends ${(booked.startMs - it.endMs) / 60_000} min before"}" } ?: "nothing"}")
val page = whatsOnPage(mapOf(PREMIERE_NUMBER to ChannelPlan(plan301, ScheduleCursor())), null, booked.startMs - 3 * 3_600_000L, zone)
val item = (listOfNotNull(page.pick) + page.tonight + page.comingUp).firstOrNull { it.title.contains(d.film.title) }
out.appendLine(" What's On, three hours before: ${item?.let { "${it.tag} at ${at(it.startMs)}" } ?: "not listed"}")
val home = d.call.home
val windowEnd = d.windowEndMs(zone)
out.appendLine(" window ends ${at(windowEnd)}; channel $home first shows it ${with[home].orEmpty().filter { it.seriesId == d.film.itemId }.minOfOrNull { it.startMs }?.let(::at) ?: "after the replay ends"}")
}
out.appendLine(" competing headline events that evening: ${competingEvent(debut, debut + (booked?.media?.durationMs ?: 3 * 3_600_000L), zone, except = d.film.itemId) ?: "none"}")
val showings = with.flatMap { (n, es) -> es.filter { it.seriesId == d.film.itemId || seriesKey(it.media.item.title) == seriesKey(d.film.title) }.map { n to it } }.sortedBy { it.second.startMs }
showings.forEach { (n, e) -> out.appendLine(" $n ${at(e.startMs)} ${e.why.take(60)}") }