0.99.17: Vortex Afterburn premiere of Dragon Ball Super: Beerus (Stage D1)
Saturday 21:00 from 21 November, first airings only, two a night while two are waiting, each episode its own booking, pinned to Emby 8016753; whole Dragon Ball film before it on premiere nights, never cut. Fresh box-data replay; every channel's fingerprint identical to 0.99.16. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,9 @@ class AfterDarkReviewTest {
|
||||
@Test fun thirtyEightExactItemsLeaveAfterDarkAndOnlyThere() {
|
||||
assertEquals(38, afterDark.withdrawn.size)
|
||||
assertTrue(afterDark.withdrawn.all { EmbyClient.validId(it) })
|
||||
assertTrue(SmartChannels.filter { it.number != AFTER_DARK_NUMBER }.all { it.withdrawn.isEmpty() })
|
||||
// The only other withdrawal is Vortex's second copy of Beerus (Stage D1), so the complete copy is the one used.
|
||||
assertTrue(SmartChannels.filter { it.number != AFTER_DARK_NUMBER && it.number != VORTEX_NUMBER }.all { it.withdrawn.isEmpty() })
|
||||
assertEquals(setOf(BEERUS_OTHER_COPY), SmartChannels.first { it.number == VORTEX_NUMBER }.withdrawn)
|
||||
// The kept films are untouched: nothing withdrawn is on After Dark's own list.
|
||||
val film = { id: String, title: String -> PoolSeries(id, title, listOf(PoolEpisode(id, "src", EpisodeMark(1, 1), title, 6_000_000))) }
|
||||
val pool = listOf(film("5653603", "Koi... Mil Gaya"), film("5660745", "The Shining"), film("1", "Zombieland"), film("2", "Black Swan"), film("3", "Terrorizers"), film("4", "The Outcasts"))
|
||||
@@ -31,7 +33,7 @@ class AfterDarkReviewTest {
|
||||
|
||||
@Test fun onlyAfterDarkAndHorrorReadTheirPoolsAgain() {
|
||||
assertTrue("#withdrawn:" in afterDark.signature)
|
||||
assertTrue(SmartChannels.filter { it.number != AFTER_DARK_NUMBER }.none { "#withdrawn:" in it.signature })
|
||||
assertTrue(SmartChannels.filter { it.number != AFTER_DARK_NUMBER && it.number != VORTEX_NUMBER }.none { "#withdrawn:" in it.signature })
|
||||
}
|
||||
|
||||
@Test fun optionBLetsNineteenLighterFilmsPlayByDayAndKeepsTheIntenseOnesLate() {
|
||||
|
||||
@@ -8,13 +8,13 @@ import org.junit.Test
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Stage D proposal, read-only: Vortex with a prototype Afterburn premiere of Dragon Ball Super: Beerus on Saturdays at 21:00
|
||||
* and a shortened, Dragon Ball-themed Movie Night before it, from copies of the box's files. Nothing in the app changes:
|
||||
* the prototype blocks exist only here. Each double bill is modelled as one 46-minute programme, which is how it would fill
|
||||
* the evening; Beerus joins the pool only after Saturday 14 November's evening, as a booking release installed by then
|
||||
* would make it. Run by hand:
|
||||
* Stage D1's check: Vortex as built, with the Afterburn premiere of Dragon Ball Super: Beerus, from copies of the box's files.
|
||||
* Beerus's four episodes, as the box's inspection read them (Emby 8016753, 23 minutes each; their exact seconds aren't in that
|
||||
* read, so each is taken as 23:40), join Vortex's pool from the first top-up, as the release's first pool read would add them.
|
||||
* Four weeks of top-ups every six hours with Beerus and without it, avoiding every other channel's committed programmes.
|
||||
* Run by hand:
|
||||
* ORBIT_REPLAY_DIR=<copies of the box's files> ./gradlew :app:testDebugUnitTest --tests '*BeerusPremiereReplayTest*'
|
||||
* Writes beerus-premiere-replay.txt there.
|
||||
* Writes beerus-premiere-replay.txt there, and fails on any broken rule.
|
||||
*/
|
||||
class BeerusPremiereReplayTest {
|
||||
private val dir = System.getenv("ORBIT_REPLAY_DIR")?.let(::File)
|
||||
@@ -48,52 +48,63 @@ class BeerusPremiereReplayTest {
|
||||
|
||||
private fun pct(x: Double) = "%.0f%%".format(100 * x)
|
||||
|
||||
@Test fun premiere() {
|
||||
assumeTrue(dir != null && File(dir, "schedule-601.json").exists())
|
||||
val vortex = SmartChannels.first { it.number == VORTEX_NUMBER }
|
||||
val committed = plan(File(dir, "schedule-601.json")); val series = pool(File(dir, "episodes-601.json"))
|
||||
fun at(date: String, h: Int, m: Int = 0) = java.time.LocalDate.parse(date).atTime(h, m).atZone(zone).toInstant().toEpochMilli()
|
||||
fun t(ms: Long) = java.time.Instant.ofEpochMilli(ms).atZone(zone).toLocalDateTime().withNano(0)
|
||||
val minute = 60_000L
|
||||
val beerus = PoolSeries("8016753", "Dragon Ball Super: Beerus", listOf(
|
||||
PoolEpisode("8016755", "mediasource_8016755", EpisodeMark(1, 1), "Episodes 1 and 2", 46 * minute),
|
||||
PoolEpisode("8062564", "mediasource_8062564", EpisodeMark(1, 3), "Episodes 3 and 4", 46 * minute)))
|
||||
// Dragon Ball films up to an hour, leaving out the two that tell the Beerus story.
|
||||
val dbFilms = series.filter { it.isFilm && it.title.startsWith("Dragon Ball") && it.episodes[0].durationMs <= 61 * minute && "Battle of Gods" !in it.title && "Resurrection" !in it.title }
|
||||
val movie = VortexDayParts.first()
|
||||
val parts = listOf(
|
||||
DayPart(21, 22, listOf(beerus.title), days = setOf(java.time.DayOfWeek.SATURDAY), onTime = true, once = true, key = "vortex.afterburn.premiere"),
|
||||
DayPart(20, 21, dbFilms.map { it.title }, days = setOf(java.time.DayOfWeek.SATURDAY), key = movie.key),
|
||||
movie.copy(days = setOf(java.time.DayOfWeek.FRIDAY))) + VortexDayParts.drop(1)
|
||||
val joins = at("2026-11-14", 22)
|
||||
private fun replay(committed: ChannelPlan, pool: List<PoolSeries>, vortex: ChannelProgramming, avoid: ProgrammeClash, restartEvery: Int = 0): Pair<List<ScheduleEntry>, Map<Long, Pair<Long, Long>>> {
|
||||
var current = committed; var now = committed.entries.first().startMs + SCHEDULE_KEEP_PAST_MS
|
||||
val all = committed.entries.toMutableList()
|
||||
val out = StringBuilder("Stage D prototype replay: Vortex from the box's files (${t(committed.entries.first().startMs)} to ${t(committed.endMs)} committed), four weeks of top-ups every six hours.\n")
|
||||
out.appendLine("Dragon Ball films that fit an hour (Battle of Gods and Resurrection 'F' left out): ${dbFilms.size}")
|
||||
val bookedAt = mutableMapOf<Long, Pair<Long, Long>>()
|
||||
val folder = java.nio.file.Files.createTempDirectory("premiere").toFile()
|
||||
var step = 0
|
||||
while (now < committed.endMs + 28 * day) {
|
||||
val pool = if (now >= joins) series + beerus else series
|
||||
if (restartEvery > 0 && ++step % restartEvery == 0) { ScheduleStore(folder).savePlan("user", vortex.number, current); current = ScheduleStore(folder).loadPlan("user", vortex.number)!! }
|
||||
val before = current.endMs
|
||||
current = topUpPlan(current, current.tail, pool, now, vortex.filmRestMs, vortex.finishTogether, parts, zone, shuffle = vortex.shuffleEpisodes, mixed = vortex::mixes,
|
||||
current = topUpPlan(current, current.tail, pool, now, vortex.filmRestMs, vortex.finishTogether, vortex.dayParts, zone, avoid, shuffle = vortex.shuffleEpisodes, mixed = vortex::mixes,
|
||||
weightOf = vortex.tierWeights?.let { vortex::weightOf }, adaptiveRest = vortex.adaptiveFilmRest, stories = vortex.storyGrouping) ?: break
|
||||
current.entries.filter { e -> all.none { it.startMs == e.startMs } }.forEach { e -> all += e; if (e.seriesId == beerus.id) bookedAt[e.startMs] = now to before }
|
||||
current.entries.filter { e -> all.none { it.startMs == e.startMs } }.forEach { e -> all += e; if (e.seriesId == "8016753") bookedAt[e.startMs] = now to before }
|
||||
now += 6 * hour
|
||||
}
|
||||
all.sortBy { it.startMs }
|
||||
assertEquals("committed kept", committed.entries, all.take(committed.entries.size))
|
||||
bookedAt.forEach { (start, info) -> out.appendLine("premiere booked for ${t(start)} at the top-up of ${t(info.first)}; the plan then ended ${t(info.second)}, so the slot was uncommitted: ${info.second <= start}") }
|
||||
val dbs = all.filter { it.media.item.title.startsWith("Dragon Ball Super / ") }
|
||||
out.appendLine("Dragon Ball Super (2015) Beerus saga (season 1, 14 episodes): last episode booked ${dbs.lastOrNull { it.mark.season == 1 }?.let { "S${it.mark.season}E${it.mark.episode} at ${t(it.startMs)}" }}; first after it ${dbs.firstOrNull { it.mark.season > 1 }?.let { "S${it.mark.season}E${it.mark.episode} at ${t(it.startMs)}" }}" +
|
||||
"; committed plan holds up to ${dbs.filter { it.startMs < committed.endMs }.lastOrNull()?.mark}")
|
||||
return all to bookedAt
|
||||
}
|
||||
|
||||
@Test fun premiere() {
|
||||
assumeTrue(dir != null && File(dir, "schedule-601.json").exists())
|
||||
val vortex = SmartChannels.first { it.number == VORTEX_NUMBER }
|
||||
val committed = plan(File(dir, "schedule-601.json")); val series = withoutWithdrawn(pool(File(dir, "episodes-601.json")), vortex.withdrawn)
|
||||
fun at(date: String, h: Int, m: Int = 0) = java.time.LocalDate.parse(date).atTime(h, m).atZone(zone).toInstant().toEpochMilli()
|
||||
fun t(ms: Long) = java.time.Instant.ofEpochMilli(ms).atZone(zone).toLocalDateTime().withNano(0)
|
||||
val minute = 60_000L
|
||||
val beerus = PoolSeries("8016753", BEERUS, listOf("8016755", "8055410", "8062564", "8070600").mapIndexed { i, id ->
|
||||
PoolEpisode(id, "mediasource_$id", EpisodeMark(1, i + 1), "Episode ${i + 1}", 23 * minute + 40_000L) })
|
||||
val others = clashesWith(SmartChannels.filter { it.number != VORTEX_NUMBER && File(dir, "schedule-${it.number}.json").exists() }.map { plan(File(dir, "schedule-${it.number}.json")) })
|
||||
val (without, _) = replay(committed, series, vortex, others)
|
||||
val (with, bookedAt) = replay(committed, series + beerus, vortex, others)
|
||||
val (restarted, _) = replay(committed, series + beerus, vortex, others, restartEvery = 3)
|
||||
assertEquals("a save and reload every 18 hours changes nothing", with, restarted)
|
||||
val out = StringBuilder("Stage D1 replay: Vortex as built, from the box's files (committed ${t(committed.entries.first().startMs)} to ${t(committed.endMs)}), four weeks of top-ups every six hours, avoiding other channels' committed programmes.\n")
|
||||
val firstDifference = with.indices.firstOrNull { i -> without.getOrNull(i) != with[i] }?.let { with[it].startMs }
|
||||
out.appendLine("with and without Beerus, identical until ${firstDifference?.let(::t) ?: "the end"}")
|
||||
bookedAt.toSortedMap().forEach { (start, info) -> out.appendLine("premiere episode booked for ${t(start)} at the top-up of ${t(info.first)}; the plan then ended ${t(info.second)}, so the slot was uncommitted: ${info.second <= start}") }
|
||||
val dbs = with.filter { it.media.item.title.startsWith("Dragon Ball Super / ") }
|
||||
out.appendLine("Dragon Ball Super (2015) Beerus saga (season 1, 14 episodes): last episode ${dbs.lastOrNull { it.mark.season == 1 }?.let { "S${it.mark.season}E${it.mark.episode} at ${t(it.startMs)}" }}; " +
|
||||
"first after it ${dbs.firstOrNull { it.mark.season > 1 }?.let { "S${it.mark.season}E${it.mark.episode} at ${t(it.startMs)}" }}; committed plan holds up to ${dbs.filter { it.startMs < committed.endMs }.lastOrNull()?.mark}")
|
||||
for (date in listOf("2026-11-14", "2026-11-21", "2026-11-28", "2026-12-05")) {
|
||||
out.appendLine("== Saturday $date, 19:00 to 23:00")
|
||||
all.filter { it.startMs >= at(date, 19) && it.startMs < at(date, 23) }.forEach {
|
||||
out.appendLine(" ${t(it.startMs).toLocalTime()}-${t(it.endMs).toLocalTime()} ${it.media.item.title.substringBefore(" / ")} [${it.presentation.ifEmpty { "-" }}] ${it.why.substringBefore(";")}")
|
||||
with.filter { it.startMs >= at(date, 19) && it.startMs < at(date, 23) }.forEach {
|
||||
out.appendLine(" ${t(it.startMs).toLocalTime()}-${t(it.endMs).toLocalTime()} ${it.media.item.title.substringBefore(" / ")}${if (it.seriesId == beerus.id) " episode ${it.mark.episode}" else ""} [${it.presentation.ifEmpty { "-" }}] ${it.why.substringBefore(";")}${if ("premiere" in it.why) "; first airing on Orbit" else ""}")
|
||||
}
|
||||
}
|
||||
val gaps = all.zipWithNext().count { (a, b) -> a.endMs != b.startMs }
|
||||
out.appendLine("gaps or overlaps across the four weeks: $gaps")
|
||||
val premieres = with.filter { it.seriesId == beerus.id }
|
||||
val gaps = with.zipWithNext().count { (a, b) -> a.endMs != b.startMs }
|
||||
val clashes = with.filter { it.startMs >= committed.endMs }.count { e -> others(series.firstOrNull { it.id == e.seriesId } ?: beerus, e.startMs, e.endMs) }
|
||||
out.appendLine("Beerus bookings ${premieres.size}: ${premieres.map { "E${it.mark.episode} ${t(it.startMs)}" }}; gaps or overlaps $gaps; clashes with other channels $clashes; a save and reload every 18 hours gives the same: true")
|
||||
File(dir, "beerus-premiere-replay.txt").writeText(out.toString())
|
||||
println(out)
|
||||
assertEquals(listOf(1, 2, 3, 4), premieres.map { it.mark.episode })
|
||||
assertEquals(listOf(at("2026-11-21", 0), at("2026-11-21", 0), at("2026-11-28", 0), at("2026-11-28", 0)), premieres.map { java.time.Instant.ofEpochMilli(it.startMs).atZone(zone).toLocalDate().atStartOfDay(zone).toInstant().toEpochMilli() })
|
||||
premieres.chunked(2).forEach { (a, b) -> assertEquals(a.endMs, b.startMs); assertTrue(java.time.Instant.ofEpochMilli(a.startMs).atZone(zone).toLocalTime() in java.time.LocalTime.of(21, 0)..java.time.LocalTime.of(21, 10)) }
|
||||
assertTrue(bookedAt.all { (start, booking) -> booking.second <= start })
|
||||
assertTrue(firstDifference == null || firstDifference >= at("2026-11-21", 12))
|
||||
assertEquals(0, gaps)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package tv.orbit.classic
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import java.time.LocalDate
|
||||
import java.time.ZoneId
|
||||
|
||||
/** Stage D1: the Vortex Afterburn premiere of Dragon Ball Super: Beerus, on Vortex's real blocks. */
|
||||
class BeerusPremiereTest {
|
||||
private val zone = ZoneId.of("Europe/London")
|
||||
private val minute = 60_000L
|
||||
private fun at(date: String, hour: Int, min: Int = 0) = LocalDate.parse(date).atTime(hour, min).atZone(zone).toInstant().toEpochMilli()
|
||||
private fun series(title: String, count: Int, minutes: Int = 24) =
|
||||
PoolSeries(title.filter { it in 'a'..'z' || it in 'A'..'Z' || it in '0'..'9' }, title, (1..count).map { PoolEpisode("${title.filter { it in 'a'..'z' || it in 'A'..'Z' || it in '0'..'9' }}-$it", "src", EpisodeMark(1 + (it - 1) / 50, 1 + (it - 1) % 50), "E$it", minutes * minute) })
|
||||
private fun film(title: String, minutes: Int) = title.filter { it in 'a'..'z' || it in 'A'..'Z' || it in '0'..'9' }.let { id -> PoolSeries(id, title, listOf(PoolEpisode(id, "src", EpisodeMark(1, 1), title, minutes * minute)), "movie") }
|
||||
private val beerusIds = listOf("8016755", "8055410", "8062564", "8070600")
|
||||
private fun beerus(count: Int = 4) = PoolSeries("8016753", BEERUS, beerusIds.take(count).mapIndexed { i, id -> PoolEpisode(id, "mediasource_$id", EpisodeMark(1, i + 1), "E${i + 1}", 23 * minute + 40_000L) })
|
||||
private val shows = listOf(series("Dragon Ball Z", 291), series("Samurai Jack", 62), series("Batman Beyond", 52), series("Naruto", 220), series("Pokémon", 400),
|
||||
series("Attack on Titan", 89), series("ThunderCats", 125), series("Sailor Moon", 200), series("Outlaw Star", 26), series("Yu Yu Hakusho", 112))
|
||||
private val films = listOf(film("Dragon Ball Z: The World's Strongest", 59), film("Dragon Ball Z: Lord Slug", 52), film("Dragon Ball Z: Battle of Gods", 105),
|
||||
film("Dragon Ball Z: Resurrection 'F'", 93), film("Akira", 124), film("Ghost in the Shell", 83))
|
||||
private fun plan(pool: List<PoolSeries>, from: Long = at("2026-11-13", 6), until: Long = at("2026-12-07", 6), cursor: ScheduleCursor = ScheduleCursor(),
|
||||
recent: Map<String, Long> = emptyMap(), parts: List<DayPart> = VortexDayParts) =
|
||||
extendWeighted(pool, cursor, from, until, { TIER_SUPPORTING }, parts, zone, { _, _, _ -> false }, false, { false }, recent)
|
||||
private fun evening(entries: List<ScheduleEntry>, date: String) = entries.filter { it.startMs >= at(date, 19) && it.startMs < at(date, 23) }
|
||||
private fun isBeerus(e: ScheduleEntry) = e.seriesId == "8016753"
|
||||
|
||||
@Test fun theApprovedPlanOnVortexsRealBlocks() {
|
||||
val entries = plan(shows + films + beerus()).entries
|
||||
// Before 21 November, Beerus never airs and Saturday's Movie Night is as before.
|
||||
assertTrue(entries.filter { it.startMs < at("2026-11-21", 20) }.none(::isBeerus))
|
||||
assertTrue(evening(entries, "2026-11-14").any { it.media.item.type == "Movie" && it.startMs >= at("2026-11-14", 21) || it.why.startsWith("event movie") && it.endMs > at("2026-11-14", 21) })
|
||||
for ((date, expected) in listOf("2026-11-21" to listOf(1, 2), "2026-11-28" to listOf(3, 4))) {
|
||||
val night = evening(entries, date)
|
||||
val premiere = night.filter(::isBeerus)
|
||||
// Two new episodes, in order, each its own booking, back to back with nothing between them, starting within ten minutes of 21:00.
|
||||
assertEquals(expected, premiere.map { it.mark.episode })
|
||||
assertEquals(premiere[0].endMs, premiere[1].startMs)
|
||||
assertTrue("$date starts on time", premiere[0].startMs in at(date, 21)..at(date, 21, 10))
|
||||
assertTrue(premiere.all { it.presentation == "vortex.afterburn.premiere" && "premiere: first airing on Orbit" in it.why })
|
||||
// Before it, one whole Dragon Ball film that ends in time; never Battle of Gods or Resurrection 'F', never cut.
|
||||
val movie = night.single { it.media.item.type == "Movie" }
|
||||
assertTrue(movie.media.item.title in VortexPremiereFilms)
|
||||
assertTrue(movie.endMs <= premiere[0].startMs)
|
||||
// After it, Afterburn: no film.
|
||||
assertTrue(night.filter { it.startMs >= premiere[1].endMs }.none { it.media.item.type == "Movie" })
|
||||
}
|
||||
// With nothing new left, the premiere never restarts or repeats, and Saturday is back to its usual Movie Night.
|
||||
assertEquals(4, entries.count(::isBeerus))
|
||||
assertTrue(evening(entries, "2026-12-05").none(::isBeerus))
|
||||
assertTrue(entries.none { "premiere" in it.why && !isBeerus(it) })
|
||||
assertTrue(evening(entries, "2026-12-05").any { it.media.item.type == "Movie" && it.why.startsWith("event movie") })
|
||||
// Nothing else on the channel carries the premiere: Beerus is only ever in its event.
|
||||
assertTrue(entries.filter(::isBeerus).all { it.presentation == "vortex.afterburn.premiere" })
|
||||
assertEquals(0, entries.zipWithNext().count { (a, b) -> a.endMs != b.startMs })
|
||||
}
|
||||
|
||||
@Test fun aSingleEpisodeWhenOnlyOneIsWaiting() {
|
||||
// Only three episodes: two on the 21st, then one on the 28th; then nothing.
|
||||
val entries = plan(shows + films + beerus(3)).entries
|
||||
assertEquals(listOf(1, 2), evening(entries, "2026-11-21").filter(::isBeerus).map { it.mark.episode })
|
||||
assertEquals(listOf(3), evening(entries, "2026-11-28").filter(::isBeerus).map { it.mark.episode })
|
||||
assertEquals(3, entries.count(::isBeerus))
|
||||
}
|
||||
|
||||
@Test fun aTopUpOrRestartBetweenTheEpisodesKeepsThePair() {
|
||||
val pool = shows + films + beerus()
|
||||
val whole = plan(pool).entries
|
||||
val first = whole.first(::isBeerus)
|
||||
// The plan ends straight after episode 1, as a top-up might leave it, and is saved and read back before the next one.
|
||||
val before = plan(pool, until = first.endMs)
|
||||
assertEquals(whole.takeWhile { it.startMs <= first.startMs }, before.entries)
|
||||
val folder = java.nio.file.Files.createTempDirectory("premiere").toFile()
|
||||
ScheduleStore(folder).savePlan("user", VORTEX_NUMBER, before)
|
||||
val reread = ScheduleStore(folder).loadPlan("user", VORTEX_NUMBER)!!
|
||||
val recent = reread.entries.filter { it.startMs >= first.endMs - SAME_FILE_MS }.associate { it.media.item.id to it.startMs }
|
||||
val after = plan(pool, from = reread.endMs, cursor = reread.tail, recent = recent).entries
|
||||
assertEquals(2, after.first().mark.episode)
|
||||
assertTrue(isBeerus(after.first()) && after.first().startMs == first.endMs && after.first().presentation == "vortex.afterburn.premiere")
|
||||
// The cursor only moved for the episode actually booked: episode 2 was still waiting.
|
||||
assertEquals(EpisodeMark(1, 1), reread.tail.marks["8016753"])
|
||||
// The premiere's key survives being saved and read back.
|
||||
assertEquals("vortex.afterburn.premiere", reread.entries.last().presentation)
|
||||
}
|
||||
|
||||
@Test fun noFilmIsCutWhenNoneFits() {
|
||||
// Only long films: Movie Night gives way on premiere nights rather than cutting one or delaying the premiere.
|
||||
val long = listOf(film("Dragon Ball Z: Battle of Gods", 105), film("Akira", 124), film("Dragon Ball Z: Broly - Second Coming", 92))
|
||||
val entries = plan(shows + long + beerus()).entries
|
||||
val night = evening(entries, "2026-11-21")
|
||||
val premiere = night.filter(::isBeerus)
|
||||
assertEquals(listOf(1, 2), premiere.map { it.mark.episode })
|
||||
assertTrue(premiere[0].startMs in at("2026-11-21", 21)..at("2026-11-21", 21, 10))
|
||||
assertTrue(night.filter { it.startMs < premiere[0].startMs }.none { it.media.item.type == "Movie" })
|
||||
assertTrue(night.none { it.media.item.type == "Movie" && it.endMs > premiere[0].startMs && it.startMs < premiere[1].endMs })
|
||||
}
|
||||
|
||||
@Test fun withoutBeerusVortexIsAsBefore() {
|
||||
// The same blocks without a premiere show book exactly what Vortex's blocks before Stage D1 book.
|
||||
val before = listOf(DayPart(20, 22, group = "movie", days = setOf(java.time.DayOfWeek.FRIDAY, java.time.DayOfWeek.SATURDAY), key = "vortex.movie")) +
|
||||
VortexDayParts.dropWhile { it.days.isNotEmpty() }
|
||||
assertEquals(plan(shows + films, parts = before), plan(shows + films))
|
||||
}
|
||||
|
||||
@Test fun configuredOnVortexOnly() {
|
||||
val vortex = SmartChannels.first { it.number == VORTEX_NUMBER }
|
||||
assertTrue(vortex.tierWeights != null && BEERUS in vortex.searches && BEERUS_OTHER_COPY in vortex.withdrawn)
|
||||
val premiere = vortex.dayParts.single { it.premiere }
|
||||
assertEquals(LocalDate.of(2026, 11, 21), premiere.from)
|
||||
assertEquals(listOf(BEERUS), premiere.titles)
|
||||
assertTrue(premiere.onTime && premiere.fromHour == 21 && premiere.days == setOf(java.time.DayOfWeek.SATURDAY) && premiere.graceMs == 10 * minute)
|
||||
// Beerus is named in no everyday block.
|
||||
assertTrue(vortex.dayParts.filter { !it.premiere }.none { BEERUS in it.titles })
|
||||
assertFalse(VortexPremiereFilms.any { "Battle of Gods" in it || "Resurrection" in it })
|
||||
assertTrue(SmartChannels.filter { it.number != VORTEX_NUMBER }.none { c -> c.dayParts.any { it.premiere || it.premiereNights != null || it.from != null } })
|
||||
}
|
||||
}
|
||||
@@ -84,13 +84,14 @@ class ChannelSuggestionsTest {
|
||||
@Test fun afterDarkAndVortexBlocksAcceptTheirGroups() {
|
||||
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)
|
||||
// The Beerus premiere and its nights' Dragon Ball Movie Night (Stage D1), then Movie Night on Fridays and other Saturdays, which takes
|
||||
// reviewed films; evening suggestions stay in the evening, and daytime suggestions not yet placed by hand go late.
|
||||
assertEquals(listOf("", "", "movie", "movie", "", "", "toonami", "night", "toonami", "day"), groups)
|
||||
}
|
||||
|
||||
@Test fun vortexKeepsPaulsToonamiPicksInTheRightBlocks() {
|
||||
val vortex = SmartChannels.first { it.number == VORTEX_NUMBER }
|
||||
val day = vortex.dayParts[1].titles.map(::seriesKey)
|
||||
val day = vortex.dayParts.first { it.fromHour == 6 }.titles.map(::seriesKey)
|
||||
assertTrue(listOf("Batman Beyond", "Batman: The Animated Series", "ThunderCats", "The Powerpuff Girls", "Jonny Quest").all { seriesKey(it) in day })
|
||||
assertTrue(seriesKey("Dragon Ball Z") in vortex.dayParts.first { it.group == "toonami" }.titles.map(::seriesKey))
|
||||
assertTrue(seriesKey("Attack on Titan") !in day)
|
||||
|
||||
@@ -18,9 +18,10 @@ class PresentationTest {
|
||||
|
||||
@Test fun everyApprovedBlockKeyHasItsIdent() {
|
||||
val keys = SmartChannels.flatMap { it.dayParts }.map { it.key }.filter { it.isNotEmpty() }.toSet()
|
||||
// Riot 3, After Dark 3, Horror, Gold, Three, Vortex, Orbit 2 2, Ring X 7 (six nights and PPV), Terra.
|
||||
assertEquals(20, keys.size)
|
||||
assertEquals(emptySet<String>(), keys - BlockIdents.keys)
|
||||
// Riot 3, After Dark 3, Horror, Gold, Three, Vortex, Orbit 2 2, Ring X 7 (six nights and PPV), Terra, and the Vortex Afterburn premiere.
|
||||
assertEquals(21, keys.size)
|
||||
// The premiere's own ident isn't made yet: until it is, the standard Vortex ident plays (Stage D1).
|
||||
assertEquals(setOf("vortex.afterburn.premiere"), keys - BlockIdents.keys)
|
||||
assertTrue(keys.all { PRESENTATION_KEY.matches(it) })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user