Paradox: six fantasy series from 21:00 (option B); refresh limit 26 with a guard

Paul, 30 November 2026: The Vampire Diaries, The 100, Shadowhunters and Locke & Key from 21:00;
Chilling Adventures of Sabrina and Wednesday late. 18:00 to 21:00 stays Buffy, Angel, Supernatural and
Fringe. The refresh limit goes from 20 to 26; SeriesLimitTest fails if any channel lists more series than
it reads, and the TV logs seriesLimitReached if a read stops with the list unread. Simulated as built:
bookings kept, no clashes, gaps or broken order, Paradox's 18:00 to 21:00 unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 10:37:40 +00:00
co-authored by Claude Opus 5.5
parent cb95897167
commit 65df2fe8c0
5 changed files with 52 additions and 11 deletions
@@ -142,9 +142,15 @@ private val ParadoxPrimeTime = listOf("Buffy the Vampire Slayer", "Angel", "Supe
private val ParadoxLate = listOf("Twin Peaks", "The Outer Limits", "The Outer Limits (1995)", "Torchwood", "Farscape", "The X-Files")
/** Adult anthology for the late evening only (approved by Paul on 4 November 2026): standalone stories, in a mixed order. */
private val ParadoxAdult = listOf("Black Mirror")
private val ParadoxShows get() = (ParadoxStandalones + ParadoxPrimeTime + ParadoxLate + ParadoxAdult).distinct()
private val ParadoxDayParts get() = listOf(DayPart(6, 18, ParadoxStandalones), DayPart(18, 21, ParadoxPrimeTime), DayPart(21, 23, ParadoxPrimeTime + ParadoxAdult),
DayPart(23, 6, ParadoxLate + ParadoxAdult))
/**
* Fantasy drama (Paul, 30 November 2026, option B): from 21:00 only, so 18:00 to 21:00 stays Buffy, Angel, Supernatural and
* Fringe; the darker two late. Simulated first (ParadoxFantasySimulationTest): bookings kept, Paradox's prime time unchanged.
*/
private val ParadoxFantasy = listOf("The Vampire Diaries", "The 100", "Shadowhunters", "Locke & Key")
private val ParadoxFantasyLate = listOf("Chilling Adventures of Sabrina", "Wednesday")
private val ParadoxShows get() = (ParadoxStandalones + ParadoxPrimeTime + ParadoxLate + ParadoxAdult + ParadoxFantasy + ParadoxFantasyLate).distinct()
private val ParadoxDayParts get() = listOf(DayPart(6, 18, ParadoxStandalones), DayPart(18, 21, ParadoxPrimeTime), DayPart(21, 23, ParadoxPrimeTime + ParadoxAdult + ParadoxFantasy),
DayPart(23, 6, ParadoxLate + ParadoxAdult + ParadoxFantasyLate))
private val NotCultCinema = setOf("Family", "Animation", "Documentary", "Music")
@@ -270,7 +276,8 @@ internal val BuiltInChannels = listOf(
ChannelProgramming(201, "Terra", TerraShows, seriesCount = TerraShows.size, finishTogether = true, exactTitles = true, dayParts = channelParts(201), storyGrouping = true),
ChannelProgramming(TOTS_NUMBER, "Tots", TotsShows, seriesCount = 40, finishTogether = true, exactTitles = true, dayParts = channelParts(TOTS_NUMBER), shuffleEpisodes = true,
tierWeights = TotsTiers, catalogueScaleHours = CATALOGUE_SCALE_HOURS, storyGrouping = true, shorts = TotsShorts),
ChannelProgramming(106, "Paradox", ParadoxShows, seriesCount = 20, finishTogether = true, exactTitles = true, dayParts = channelParts(106), shuffleTitles = (ParadoxStandalones + ParadoxAdult).toSet(),
// The refresh limit: 26 since the fantasy series joined (Paul, 30 November 2026); SeriesLimitTest keeps it above the list.
ChannelProgramming(106, "Paradox", ParadoxShows, seriesCount = 26, finishTogether = true, exactTitles = true, dayParts = channelParts(106), shuffleTitles = (ParadoxStandalones + ParadoxAdult).toSet(),
tierWeights = ParadoxTiers, storyGrouping = true)) +
ChannelPresets.filter { it.smartOnly }.map { ChannelProgramming(it.number, it.name, it.searches, seriesCount = if (it.films) it.searches.size else maxOf(60, it.searches.size), finishTogether = !it.films, exactTitles = true,
filmRestMs = if (it.films) 7 * 24 * 60 * 60_000L else null,
@@ -425,7 +425,11 @@ internal class EmbySampleSession(private val transport: EmbyTransport, private v
if (best != null) pool += best
}
} else for ((index, search) in programming.searches.withIndex()) {
if (pool.size == programming.seriesCount) break
// The limit reached with the list unread: logged, so an approved series can't drop out unnoticed (30 November 2026).
if (pool.size == programming.seriesCount) {
android.util.Log.w("OrbitSchedule", "channel=${programming.number} seriesLimitReached limit=${programming.seriesCount} unread=${programming.searches.size - index}")
break
}
checkActive()
if (!hasSeries(search)) continue
requests++
@@ -59,9 +59,10 @@ class LibraryTitlesTest {
assertEquals(readAll(before, null), readAll(after, index))
// Everything the library has is still asked about, in the same order; only the misses are gone.
val searches = { l: Library -> l.paths.filter { "SearchTerm=" in it } }
assertEquals(385, searches(before).size)
// 385, and Paradox's six fantasy series (30 November 2026).
assertEquals(391, searches(before).size)
assertEquals(before.paths.filter { "SearchTerm=" !in it }, after.paths.filter { "SearchTerm=" !in it })
// 17 of 385: the 16 listed titles it has, and one listed show whose name starts another it has (which the old search also matched).
// 17 of 391: the 16 listed titles it has, and one listed show whose name starts another it has (which the old search also matched).
assertEquals(17, searches(after).size)
assertEquals(searches(before).filter { p -> searches(after).contains(p) }, searches(after))
}
@@ -69,7 +70,7 @@ class LibraryTitlesTest {
@Test fun withoutAFinishedCatalogueEverythingIsSearchedAsBefore() {
val library = Library(emptyList(), emptyList())
readAll(library, null)
assertEquals(385, library.paths.size)
assertEquals(391, library.paths.size)
}
@Test fun setupRequestsKeepTheirGapButHaveNoHourlyBudget() {
@@ -39,8 +39,8 @@ class ParadoxFantasySimulationTest {
fun with(newPrimeFrom18: Boolean) = parts.filter { it.days.isNotEmpty() } + parts.filter { it.days.isEmpty() }.map { part ->
when {
part.covers(18) && newPrimeFrom18 -> part.copy(titles = part.titles + prime)
part.covers(21) && part.fromHour == 21 -> part.copy(titles = part.titles + prime)
part.covers(23) -> part.copy(titles = part.titles + late)
part.covers(21) && part.fromHour == 21 -> part.copy(titles = (part.titles + prime).distinct())
part.covers(23) -> part.copy(titles = (part.titles + late).distinct())
else -> part
} }
val others = (SmartChannels.map { it.number } - setOf(106) + DRIVE_IN_NUMBER).mapNotNull { n -> store.loadPlan(user, n)?.let { n to it } }.toMap()
@@ -74,7 +74,8 @@ class ParadoxFantasySimulationTest {
"(18:00 to 21:00: ${hours { seriesKey(title(it)) in primeKeys && local(it.startMs).hour in 18..20 }} h); daytime standalones ${hours { local(it.startMs).hour in 6..17 }} h; " +
"clashes $clashes; gaps $gaps min; out of order $order; repeats within a week $repeats\n")
}
run("now", existingPool, parts)
run("now (without the six)", existingPool, parts)
run("as built (option B, 30 November 2026)", existingPool + added, parts)
run("A: from 18:00", existingPool + added, with(true))
run("B: from 21:00", existingPool + added, with(false))
File(out, "paradox-summary.txt").writeText(report.toString()); println(report)
@@ -0,0 +1,28 @@
package tv.orbit.classic
import org.junit.Assert.assertEquals
import org.junit.Test
/**
* No approved series is left out by a channel's refresh limit (Paul, 30 November 2026: Paradox's limit of 20 would have
* silently dropped series past the 20th). A series channel reads its list in order and stops at [ChannelProgramming.seriesCount].
*/
class SeriesLimitTest {
@Test fun everySeriesChannelReadsItsWholeList() {
val short = SmartChannels.filter { it.filmRestMs == null }.mapNotNull { p ->
val listed = p.searches.distinct().size
if (listed > p.seriesCount) "${p.number} ${p.name}: $listed listed, limit ${p.seriesCount}" else null
}
assertEquals(emptyList<String>(), short)
}
/** Paradox option B (Paul, 30 November 2026): the fantasy series only from 21:00; 18:00 to 21:00 is unchanged. */
@Test fun paradoxKeepsItsPrimeTime() {
val p = SmartChannels.first { it.number == 106 }
fun at(h: Int) = p.dayParts.first { it.days.isEmpty() && it.covers(h) }.titles
assertEquals(listOf("Buffy the Vampire Slayer", "Angel", "Supernatural", "Fringe"), at(19))
listOf("The Vampire Diaries", "The 100", "Shadowhunters", "Locke & Key").forEach { t -> assertEquals(t, true, t in at(21)); (6 until 21).forEach { h -> assertEquals("$t at $h", false, t in at(h)) } }
listOf("Chilling Adventures of Sabrina", "Wednesday").forEach { t -> assertEquals(t, true, t in at(23)); (6 until 23).forEach { h -> assertEquals("$t at $h", false, t in at(h)) } }
assertEquals(26, p.seriesCount)
}
}