0.91.0: Slasher Saturday, B-Movie Throwbacks and Cult Classics
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 1m52s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m25s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-03 14:47:12 +00:00
co-authored by Claude Opus 5.5
parent eb1d5f7764
commit 5846235870
14 changed files with 112 additions and 22 deletions
@@ -114,10 +114,27 @@ class ChannelIdentityTest {
assertTrue("Band of Brothers waits for a drama home", odyssey.dayParts.none { part -> part.titles.any { seriesKey(it) == seriesKey("Band of Brothers") } })
assertTrue(seriesKey("Band of Brothers") in odyssey.searches.map(::seriesKey))
val wild = plan(203, 42)
assertTrue(titlesWhere(wild) { it.dayOfWeek != java.time.DayOfWeek.SATURDAY && (it.hour >= 22 || it.hour < 6) }.none { it == "Dirty Jobs" })
// Saturday night runs on into the small hours of Sunday.
val saturdayNight = { t: ZonedDateTime -> (t.dayOfWeek == java.time.DayOfWeek.SATURDAY && t.hour >= 22) || (t.dayOfWeek == java.time.DayOfWeek.SUNDAY && t.hour < 6) }
assertTrue(titlesWhere(wild) { !saturdayNight(it) && (it.hour >= 22 || it.hour < 6) }.none { it == "Dirty Jobs" })
val evidence = plan(107, 44)
val lineOfDuty = evidence.entries.filter { it.media.item.title.startsWith("Line of Duty") }.map { it.mark.episode }
assertEquals(lineOfDuty.sorted(), lineOfDuty)
assertTrue(titlesWhere(evidence) { it.hour in 6..17 }.none { it == "Luther" })
}
@Test fun filmEventsKeepTheirNightsAndTheirFilms() {
val horror = SmartChannels.first { it.number == 304 }
val after = SmartChannels.first { it.number == AFTER_DARK_NUMBER }
fun at(day: Int, hour: Int) = ZonedDateTime.of(2026, 11, day, hour, 30, 0, 0, zone).toInstant().toEpochMilli()
fun film(title: String) = PoolSeries(title, title, listOf(PoolEpisode(title, "src", EpisodeMark(1, 1), title, 95 * 60_000L)))
val pool = listOf(film("Halloween"), film("Sleepaway Camp"), film("The Exorcist"), film("Repo Man"), film("Basket Case"), film("Jaws"))
// Saturday 14 November: the slashers from 20:00, still Saturday night at 01:30 on Sunday, and gone by Sunday evening.
assertEquals(setOf("Halloween", "Sleepaway Camp"), dayPartChoice(pool, horror.dayParts, at(14, 21), zone).first.map { it.title }.toSet())
assertEquals(setOf("Halloween", "Sleepaway Camp"), dayPartChoice(pool, horror.dayParts, at(15, 1), zone).first.map { it.title }.toSet())
assertEquals(pool.size, dayPartChoice(pool, horror.dayParts, at(15, 21), zone).first.size)
assertEquals(listOf("Basket Case"), dayPartChoice(pool, after.dayParts, at(13, 22), zone).first.map { it.title })
assertEquals(listOf("Repo Man"), dayPartChoice(pool, after.dayParts, at(16, 0), zone).first.map { it.title })
assertTrue(after.searches.size == after.seriesCount)
}
}
@@ -82,7 +82,7 @@ class ChannelSuggestionsTest {
}
@Test fun afterDarkAndVortexBlocksAcceptTheirGroups() {
assertEquals("day", SmartChannels.first { it.number == AFTER_DARK_NUMBER }.dayParts[1].group)
assertEquals(1, SmartChannels.first { it.number == AFTER_DARK_NUMBER }.dayParts.count { it.group == "day" })
val groups = SmartChannels.first { it.number == VORTEX_NUMBER }.dayParts.map { it.group }
// Movie Night takes reviewed films, evening suggestions stay in the evening, and daytime suggestions not yet placed by hand go late.
assertEquals(listOf("movie", "", "", "toonami", "night", "toonami", "day"), groups)