Approved Drive-In events book on their IMDb IDs, not their cast lists
Ported from the release line. Discovery can still use a person rule; an approved event's films book on their IMDb IDs and a copy that plays. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ class FriendsLibraryTest {
|
||||
// Universal: every film, Dracula twice, one copy unplayable.
|
||||
Film("m-drac-a", "Dracula", 1931, "tt0021814", container = "iso"), Film("m-drac-b", "Dracula", 1931, "tt0021814"),
|
||||
Film("m-frank", "Frankenstein", 1931, "tt0021884"), Film("m-wolf", "The Wolf Man", 1941, "tt0034398"),
|
||||
// Arnie: all three, but the library doesn't list him in The Running Man's cast.
|
||||
// Arnie: all three, though the library doesn't list him in The Running Man's cast.
|
||||
Film("m-commando", "Commando", 1985, "tt0088944", cast = listOf("Arnold Schwarzenegger")), Film("m-recall", "Total Recall", 1990, "tt0100802", cast = listOf("Arnold Schwarzenegger")),
|
||||
Film("m-running", "The Running Man", 1987, "tt0093894"),
|
||||
Film("m-bluey", "Bluey: The Sign", 2024, null))
|
||||
@@ -136,21 +136,27 @@ class FriendsLibraryTest {
|
||||
assertEquals(setOf("universal", "arnie"), CuratedDriveInEvents.list.map { it.key }.toSet())
|
||||
assertEquals(listOf("tt0051554"), CuratedDriveInEvents.missing["hammer"])
|
||||
assertEquals(listOf("m-drac-a", "m-drac-b"), CuratedDriveInEvents.copies["tt0021814"])
|
||||
val listed = CuratedDriveInEvents.list.flatMap { e -> e.films.flatMap { f -> eventFilmCopies(e, f, CuratedDriveInEvents.copies).map { EventFilm(f.title, f.year, f.imdb, it) to e.person } } }
|
||||
val listed = CuratedDriveInEvents.list.flatMap { e -> e.films.flatMap { f -> eventFilmCopies(e, f, CuratedDriveInEvents.copies).map { EventFilm(f.title, f.year, f.imdb, it) to null } } }
|
||||
val checks = session.readFilmChecks(listed)
|
||||
assertEquals("unplayable", checks.getValue("m-drac-a").reason); assertEquals("verified", checks.getValue("m-drac-b").reason)
|
||||
assertEquals("person not in cast", checks.getValue("m-running").reason)
|
||||
// The Running Man is the right film by its IMDb ID: a cast list without Arnie in it doesn't stop an approved event.
|
||||
assertEquals("verified", checks.getValue("m-running").reason)
|
||||
val verified = checks.values.mapNotNull { it.film }.associateBy { it.id }
|
||||
val booking = chooseEventCopies(CuratedDriveInEvents.list, CuratedDriveInEvents.copies, verified.keys)
|
||||
assertEquals("m-drac-b", booking.single { it.key == "universal" }.films.first().itemId)
|
||||
|
||||
// Booked as the box books: Universal on its Saturday from the copies that play; Arnie and Hammer not at all, not even in part.
|
||||
assertEquals(listOf("m-commando", "m-recall", "m-running"), booking.single { it.key == "arnie" }.films.map { it.itemId })
|
||||
// Booked as the box books: Universal on its Saturday from the copies that play; Hammer not at all, not even in part.
|
||||
val pool = (1..40).map { n -> PoolSeries("p$n", "Film $n", listOf(PoolEpisode("p$n", "s$n", EpisodeMark(1, 1), "Film $n", 100 * 60_000L))) }
|
||||
var plan: ChannelPlan? = null; var now = LocalDateTime.of(2026, 11, 12, 12, 0).atZone(zone).toInstant().toEpochMilli()
|
||||
repeat(4) { plan = planDriveIn(plan, pool, pool, pool, now, zone, events = booking, eventFilms = verified); now += 24 * 60 * 60_000L }
|
||||
val events = plan!!.entries.filter { it.why.startsWith(DRIVE_IN_EVENT_WHY) }
|
||||
assertEquals(listOf("m-drac-b", "m-frank", "m-wolf"), events.map { it.seriesId })
|
||||
assertTrue(plan!!.entries.none { it.seriesId in setOf("m-curse", "m-commando", "m-recall", "m-running", "m-drac-a") })
|
||||
assertTrue(plan!!.entries.none { it.seriesId in setOf("m-curse", "m-drac-a") })
|
||||
// Arnie's Saturday (28 November) books all three once the Drive-In plans that far.
|
||||
val aired = plan!!.entries.toMutableList()
|
||||
repeat(16) { plan = planDriveIn(plan, pool, pool, pool, now, zone, events = booking, eventFilms = verified); aired += plan!!.entries; now += 24 * 60 * 60_000L }
|
||||
assertEquals(listOf("m-commando", "m-recall", "m-running"), aired.distinctBy { it.startMs }.filter { it.seriesId in setOf("m-commando", "m-recall", "m-running") }.map { it.seriesId })
|
||||
|
||||
// Everything Sam's server produced is in Sam's folder; the box's own data is as it was.
|
||||
assertEquals("paul's drive-in", java.io.File(noBackup, "schedule/schedule-300.json").readText())
|
||||
|
||||
Reference in New Issue
Block a user