diff --git a/android/app/src/main/java/tv/orbit/classic/BlockIdents.kt b/android/app/src/main/java/tv/orbit/classic/BlockIdents.kt index 98ea1c03..85b83b20 100644 --- a/android/app/src/main/java/tv/orbit/classic/BlockIdents.kt +++ b/android/app/src/main/java/tv/orbit/classic/BlockIdents.kt @@ -77,6 +77,11 @@ internal val BlockIdents: Map = mapOf( "punchline.star" to BlockIdent(R.raw.block_punchline_star, R.raw.block_punchline_star_sting), "punchline.classic" to BlockIdent(R.raw.block_punchline_classic, R.raw.block_punchline_classic_sting), "punchline.british" to BlockIdent(R.raw.block_punchline_british, R.raw.block_punchline_british_sting), + "wondertv.breakfast" to BlockIdent(R.raw.block_wondertv_breakfast, R.raw.block_wondertv_breakfast_sting), + "wondertv.classics" to BlockIdent(R.raw.block_wondertv_classics, R.raw.block_wondertv_classics_sting), + "wondertv.afterschool" to BlockIdent(R.raw.block_wondertv_afterschool, R.raw.block_wondertv_afterschool_sting), + "wondertv.featured" to BlockIdent(R.raw.block_wondertv_featured, R.raw.block_wondertv_featured_sting), + "wondertv.late" to BlockIdent(R.raw.block_wondertv_late, R.raw.block_wondertv_late_sting), "syndicate.publicenemies" to BlockIdent(R.raw.block_syndicate_publicenemies, R.raw.block_syndicate_publicenemies_sting), "syndicate.corner" to BlockIdent(R.raw.block_syndicate_corner, R.raw.block_syndicate_corner_sting), "syndicate.job" to BlockIdent(R.raw.block_syndicate_job, R.raw.block_syndicate_job_sting), diff --git a/android/app/src/main/java/tv/orbit/classic/ChannelBranding.kt b/android/app/src/main/java/tv/orbit/classic/ChannelBranding.kt index 58f32c76..5f36a3b0 100644 --- a/android/app/src/main/java/tv/orbit/classic/ChannelBranding.kt +++ b/android/app/src/main/java/tv/orbit/classic/ChannelBranding.kt @@ -39,6 +39,7 @@ internal object ChannelBrands { 108 to ChannelBranding("orbit-play", "Orbit Play", R.drawable.orbit_play_epg, R.drawable.orbit_play_background, R.drawable.orbit_play_bug, ChannelCategory.Entertainment), 102 to ChannelBranding("orbit-2", "Orbit 2", R.drawable.orbit_2_epg, R.drawable.orbit_one_background, R.drawable.orbit_2_bug, ChannelCategory.Entertainment), 612 to ChannelBranding("wonder", "Orbit Wonder", R.drawable.wonder_epg, R.drawable.orbit_one_background, R.drawable.wonder_bug, ChannelCategory.Kids), + WONDER_TV_NUMBER to ChannelBranding("orbit-wonder-tv", "Wonder TV", R.drawable.orbit_wonder_tv_epg, R.drawable.orbit_one_background, R.drawable.orbit_wonder_tv_bug, ChannelCategory.Kids), 613 to ChannelBranding("orbit-pixelz", "Orbit PixelZ", R.drawable.orbit_pixelz_epg, R.drawable.orbit_one_background, R.drawable.orbit_pixelz_bug, ChannelCategory.Kids), 306 to ChannelBranding("orbit-vhs", "Orbit VHS", R.drawable.orbit_vhs_epg, R.drawable.orbit_one_background, R.drawable.orbit_vhs_bug, ChannelCategory.Movies), 303 to ChannelBranding("orbit-sci-fi", "Orbit Sci-Fi", R.drawable.orbit_sci_fi_epg, R.drawable.orbit_one_background, R.drawable.orbit_sci_fi_bug, ChannelCategory.Movies), diff --git a/android/app/src/main/java/tv/orbit/classic/ChannelPalette.kt b/android/app/src/main/java/tv/orbit/classic/ChannelPalette.kt index 4a0329ba..dde846e9 100644 --- a/android/app/src/main/java/tv/orbit/classic/ChannelPalette.kt +++ b/android/app/src/main/java/tv/orbit/classic/ChannelPalette.kt @@ -51,6 +51,7 @@ private val Palettes: Map = mapOf( 605 to ChannelPalette(0xFFFFE14D, longArrayOf(0xFFFF4FD8, 0xFFFF4FD8, 0xFF4FC3FF, 0xFF4FC3FF, 0xFFFFE14D), 0xFFFFFFFF, 0xFF141A2E, 0xFFFF4FD8), 611 to ChannelPalette(0xFF9EF0FF, longArrayOf(0xFFFFB13D, 0xFFFFB13D, 0xFF7AD35A, 0xFF3FB0E0, 0xFF9EF0FF), 0xFFFFFFFF, 0xFF0B1A33, 0xFF3FB0E0), 612 to ChannelPalette(0xFFF4F0FF, longArrayOf(0xFFF6D04D, 0xFFF6D04D, 0xFF8F8CFF, 0xFF5A56C9, 0xFFF4F0FF), 0xFFF6D04D, 0xFF070A1F, 0xFF5A56C9), + WONDER_TV_NUMBER to ChannelPalette(0xFFF4F0FF, longArrayOf(0xFFF6D04D, 0xFFF6D04D, 0xFF8F8CFF, 0xFF5A56C9, 0xFFF4F0FF), 0xFFF6D04D, 0xFF070A1F, 0xFF5A56C9), 613 to ChannelPalette(0xFF7DFF8A, longArrayOf(0xFF2FD16B, 0xFF2FD16B, 0xFF4F7DFF, 0xFFFF4FD8, 0xFFFFE14D), 0xFFFFFFFF, 0xFF06060F, 0xFF4F7DFF), 614 to ChannelPalette(0xFFFFD970, longArrayOf(0xFFFFAB70, 0xFFFFAB70, 0xFFF7A1C4, 0xFFF7A1C4, 0xFFFFD970), 0xFFFFFFFF, 0xFF1D1430, 0xFFF7A1C4), ) diff --git a/android/app/src/main/java/tv/orbit/classic/ChannelPresets.kt b/android/app/src/main/java/tv/orbit/classic/ChannelPresets.kt index 371f1e4a..a894cf29 100644 --- a/android/app/src/main/java/tv/orbit/classic/ChannelPresets.kt +++ b/android/app/src/main/java/tv/orbit/classic/ChannelPresets.kt @@ -58,6 +58,7 @@ internal val ChannelPresets = listOf( ChannelPreset(STORIES_NUMBER, "Orbit Stories", StoriesShows, smartOnly = true), ChannelPreset(ATLAS_NUMBER, "ATLAS", AtlasShows, smartOnly = true), ChannelPreset(SYNDICATE_NUMBER, "SYNDICATE", SyndicateShows, smartOnly = true), + ChannelPreset(WONDER_TV_NUMBER, "Wonder TV", WonderTvShows, smartOnly = true), ChannelPreset(PUNCHLINE_NUMBER, "PUNCHLINE", PunchlineFilms, smartOnly = true, films = true), ChannelPreset(CHRISTMAS_NUMBER, "Orbit Christmas", ChristmasFilms, smartOnly = true, films = true), ChannelPreset(206, "Orbit Home", HomeShows, smartOnly = true), diff --git a/android/app/src/main/java/tv/orbit/classic/ChannelSchedule.kt b/android/app/src/main/java/tv/orbit/classic/ChannelSchedule.kt index 9da61d7c..1ac5bbc6 100644 --- a/android/app/src/main/java/tv/orbit/classic/ChannelSchedule.kt +++ b/android/app/src/main/java/tv/orbit/classic/ChannelSchedule.kt @@ -278,9 +278,9 @@ internal val BuiltInChannels = listOf( // ATLAS (24 November 2026) plays international programmes in their own language: no English-sound filter; its own // rule ([AtlasPlayback]) is applied as its pools are read instead. englishAudio = it.number != ATLAS_NUMBER, - channelFilms = if (it.number == 401) PpvSunday else if (it.number == ATLAS_NUMBER) AtlasFilms else if (it.number == SYNDICATE_NUMBER) SyndicateFilms else emptyList(), tierWeights = SmartChannelTiers[it.number], adaptiveFilmRest = it.number in AdaptiveFilmRestChannels, + channelFilms = if (it.number == 401) PpvSunday else if (it.number == ATLAS_NUMBER) AtlasFilms else if (it.number == SYNDICATE_NUMBER) SyndicateFilms else if (it.number == WONDER_TV_NUMBER) WonderTvFilms else emptyList(), tierWeights = SmartChannelTiers[it.number], adaptiveFilmRest = it.number in AdaptiveFilmRestChannels, // SYNDICATE (25 November 2026) books films every day, so each rests five days, as across the network. - fileRestMs = if (it.number == SYNDICATE_NUMBER) NETWORK_FILM_REST_MS else SAME_FILE_MS, + fileRestMs = if (it.number == SYNDICATE_NUMBER) NETWORK_FILM_REST_MS else if (it.number == WONDER_TV_NUMBER) WONDER_TV_FILM_REST_MS else SAME_FILE_MS, catalogueScaleHours = if (it.number in CatalogueScaledChannels) CATALOGUE_SCALE_HOURS else null, catalogueScaleFloor = CatalogueScaleFloors[it.number] ?: MIN_CATALOGUE_SCALE, storyGrouping = it.number in StoryGroupingChannels, shorts = if (it.number == 605) ToonZShorts else null) } @@ -291,7 +291,7 @@ internal val BuiltInChannels = listOf( * other series channel since 5 November 2026 (Paul: part ones first, everywhere): weighted blocks book a story whole, and a * mixed show in equal turns keeps it whole and in order in its deck. */ -private val StoryGroupingChannels get() = setOf(101, 102, 103, 104, 105, 107, 108, 109, 110, AMERICANA_NUMBER, STORIES_NUMBER, ATLAS_NUMBER, SYNDICATE_NUMBER, 202, 203, 204, 205, 206, 401, 602, 603, 604, 605, 611) +private val StoryGroupingChannels get() = setOf(101, 102, 103, 104, 105, 107, 108, 109, 110, AMERICANA_NUMBER, STORIES_NUMBER, ATLAS_NUMBER, SYNDICATE_NUMBER, WONDER_TV_NUMBER, 202, 203, 204, 205, 206, 401, 602, 603, 604, 605, 611) /** * Where a short series must keep at least half its tier's weight, so the hybrid trims its weekly repeats without cutting its @@ -304,7 +304,7 @@ private val AdaptiveFilmRestChannels get() = setOf(301) /** Editorially weighted rotation, per channel, once its tiers are approved: Orbit Three (0.97.0), Odyssey, Wild, Orbit X and ToonZ (0.98.0), then Orbit 1, Orbit 2, Gold, Evidence and Heroes (0.99.4; Vortex and Paradox are set above). */ private val SmartChannelTiers: Map> get() = mapOf(103 to ThreeTiers, 202 to OdysseyTiers, 203 to WildTiers, 603 to OrbitXTiers, 605 to ToonZTiers, - 101 to Orbit1Tiers, 102 to Orbit2Tiers, 104 to GoldTiers, 108 to PlayTiers, STORIES_NUMBER to StoriesTiers, ATLAS_NUMBER to AtlasTiers, SYNDICATE_NUMBER to SyndicateTiers, 107 to EvidenceTiers, 602 to HeroesTiers, 604 to RewindTiers, 204 to DarkFilesTiers) + 101 to Orbit1Tiers, 102 to Orbit2Tiers, 104 to GoldTiers, 108 to PlayTiers, STORIES_NUMBER to StoriesTiers, ATLAS_NUMBER to AtlasTiers, SYNDICATE_NUMBER to SyndicateTiers, WONDER_TV_NUMBER to WonderTvTiers, 107 to EvidenceTiers, 602 to HeroesTiers, 604 to RewindTiers, 204 to DarkFilesTiers) /** * Weighted channels whose short catalogues are scaled down ([ChannelProgramming.catalogueScaleHours]): Rewind and Dark Files, @@ -323,7 +323,7 @@ private val SmartChannelMixed: Map> get() = mapOf(101 to Orbit1 private val SmartChannelParts: Map> get() = mapOf(101 to Orbit1DayParts, 102 to Orbit2DayParts, 103 to ThreeDayParts, 104 to GoldDayParts, 105 to RiotDayParts, 304 to HorrorDayParts, 602 to HeroesDayParts, 603 to OrbitXDayParts, 604 to RewindDayParts, 605 to ToonZDayParts, 204 to DarkFilesDayParts, 203 to WildDayParts, 202 to OdysseyDayParts, 107 to EvidenceDayParts, 401 to RingXDayParts, 611 to JuniorDayParts, 205 to KitchenDayParts, 206 to HomeDayParts, 108 to PlayDayParts, - 109 to SignatureDayParts, 110 to UnscriptedDayParts, CHRISTMAS_NUMBER to ChristmasDayParts, AMERICANA_NUMBER to AmericanaDayParts, ATLAS_NUMBER to AtlasDayParts, SYNDICATE_NUMBER to SyndicateDayParts, PUNCHLINE_NUMBER to PunchlineDayParts, WONDER_NUMBER to WonderDayParts, OUTLAW_NUMBER to OutlawDayParts, SILVER_SCREEN_NUMBER to SilverScreenDayParts, STORIES_NUMBER to StoriesDayParts) + 109 to SignatureDayParts, 110 to UnscriptedDayParts, CHRISTMAS_NUMBER to ChristmasDayParts, AMERICANA_NUMBER to AmericanaDayParts, ATLAS_NUMBER to AtlasDayParts, SYNDICATE_NUMBER to SyndicateDayParts, PUNCHLINE_NUMBER to PunchlineDayParts, WONDER_NUMBER to WonderDayParts, WONDER_TV_NUMBER to WonderTvDayParts, OUTLAW_NUMBER to OutlawDayParts, SILVER_SCREEN_NUMBER to SilverScreenDayParts, STORIES_NUMBER to StoriesDayParts) /** Optional bigger pools, only used once reviewed. No rule for Orbit Gold or Orbit Three: nothing in the library's details can tell a British sitcom apart. */ private val SmartChannelRules: Map> get() = mapOf( diff --git a/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt b/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt index 9488673a..c2c382bd 100644 --- a/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt +++ b/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt @@ -620,7 +620,7 @@ internal class ChannelScheduler(private val store: ScheduleStore, val plan = topUpPlan(existing, base, pool?.series?.let { withOpenApprovals(withoutOddRuntimes(withoutFailed(it, store.loadFailed(userId)), number, store.runtimeReleases().load()), choices) }?.let { if (programming.mixedTurns) mixedTurnOrder(it, number) else it }, now, programming.filmRestMs, programming.finishTogether, programming.dayParts, // SYNDICATE, a series channel that books films every day, also rests a film another channel shows within five days // (25 November 2026), as the film channels do: a preference, given up only when nothing else fits, like a clash. - avoid = { show, startMs, endMs -> others(show, startMs, endMs) || (number == SYNDICATE_NUMBER && show.isFilm && restingElsewhere(show, startMs)) }, + avoid = { show, startMs, endMs -> others(show, startMs, endMs) || ((number == SYNDICATE_NUMBER || number == WONDER_TV_NUMBER) && show.isFilm && restingElsewhere(show, startMs)) }, shuffle = programming.shuffleEpisodes, mixed = programming::mixes, weightOf = programming.tierWeights?.let { programming::weightOf }, adaptiveRest = programming.adaptiveFilmRest, fileRestMs = programming.fileRestMs, stories = programming.storyGrouping, shorts = programming.shorts, marathon = programming.marathon, seasonEndMs = seasonEndMs(number, now), network = network) ?: throw EmbyCheckException("${programming.name} has no episodes to schedule.") diff --git a/android/app/src/main/java/tv/orbit/classic/DirectorScoring.kt b/android/app/src/main/java/tv/orbit/classic/DirectorScoring.kt index fa8a0195..97d9f6a4 100644 --- a/android/app/src/main/java/tv/orbit/classic/DirectorScoring.kt +++ b/android/app/src/main/java/tv/orbit/classic/DirectorScoring.kt @@ -151,7 +151,11 @@ internal val BaseBriefs: List = listOf( // PUNCHLINE: comedy cinema across every era (Detour keeps its party and road-trip comedy); stand-up for The Comedy Club. Brief(PUNCHLINE_NUMBER, "PUNCHLINE", setOf("Movie"), setOf("Comedy"), setOf("Comedy"), w("comedy", "comedian", "spoof", "parody", "slapstick", "stand-up", "farce", "satire", "hilarious", "misadventure", "mix-up"), - w("documentary", "animated", "horror"), 1925 to 2026, current = true)) + w("documentary", "animated", "horror"), 1925 to 2026, current = true), + // Wonder TV (Paul, 30 November 2026): live-action family and tween TV and TV movies, Disney Channel and Nickelodeon style. + Brief(WONDER_TV_NUMBER, "Wonder TV", setOf("Series", "Movie"), setOf("Comedy", "Family", "Kids", "Children", "Drama", "Fantasy", "Musical", "Music"), setOf("Family", "Kids", "Children"), + w("teen", "tween", "school", "friends", "family", "sister", "brother", "best friend", "pop star", "camp", "summer", "magic", "secret"), + w("adult", "murder", "preschool", "documentary"), 1979 to 2026, kids = true, current = true)) /** Ratings for the youngest viewers: preschool, not older children's channels. */ internal val PreschoolRatings = setOf("TV-Y", "0+", "3+") @@ -183,7 +187,7 @@ private val EventFilmWords = Regex("superhero|epic|franchise|saga|blockbuster", private val International = setOf(305, 601, 401, ATLAS_NUMBER) private val AnimatedChannels = setOf(105, 601, 602, 603, 604, 605, 611, 612, 613, 614) private val FactualChannels = setOf(201, 202, 203, 204, 401) -private val FictionChannels = setOf(ATLAS_NUMBER, SYNDICATE_NUMBER, PUNCHLINE_NUMBER, 101, 103, 104, 105, 106, 107, AMERICANA_NUMBER, STORIES_NUMBER, SILVER_SCREEN_NUMBER, 301, 302, 303, 304, 305, 306, 307, 308, 309, 601, 602, 603, 604, 605, 612, 613, OUTLAW_NUMBER, FRONTLINE_NUMBER) +private val FictionChannels = setOf(WONDER_TV_NUMBER, ATLAS_NUMBER, SYNDICATE_NUMBER, PUNCHLINE_NUMBER, 101, 103, 104, 105, 106, 107, AMERICANA_NUMBER, STORIES_NUMBER, SILVER_SCREEN_NUMBER, 301, 302, 303, 304, 305, 306, 307, 308, 309, 601, 602, 603, 604, 605, 612, 613, OUTLAW_NUMBER, FRONTLINE_NUMBER) private val Stop = "a an the and or of to in on for with his her their its is are was be by as at from this that he she they it into who when after one two new life series film show story world".split(" ").toSet() private val Token = Regex("[a-z][a-z'-]{2,}") @@ -261,8 +265,15 @@ private fun foreign(e: TitleEvidence): String? { } /** One title's fit for one channel, with the evidence for it. Format, identity and age are hard limits, even for a franchise. */ +/** + * Ratings the library has wrong, reviewed title by title (Paul, 30 November 2026): these tween sitcoms are rated TV-Y in the + * library, a preschool rating, but were broadcast TV-G. The Chair reads the corrected rating; the library is not changed. + */ +internal val RatingOverrides: Map = mapOf("Even Stevens" to "TV-G", "K.C. Undercover" to "TV-G", "Big Time Rush" to "TV-G", + "Mighty Med" to "TV-G", "Legends of the Hidden Temple" to "TV-G") + internal fun channelScore(e: TitleEvidence, b: Brief, text: ChannelText, links: FranchiseLinks = FranchiseLinks.Unknown): Pair> { - val ev = mutableListOf(); val g = e.genreSet; val ov = e.overview.orEmpty(); val rating = e.rating.orEmpty(); val ch = b.number + val ev = mutableListOf(); val g = e.genreSet; val ov = e.overview.orEmpty(); val rating = (RatingOverrides[e.name] ?: e.rating).orEmpty(); val ch = b.number val all = ov + " " + e.name + " " + e.taglines.orEmpty().joinToString(" ") if (e.type !in b.kinds) return 0.0 to listOf("wrong kind") val withStudios = listOf(e.name, ov, e.studios.orEmpty().joinToString(" ")).joinToString(" ") diff --git a/android/app/src/main/java/tv/orbit/classic/FilmIdentity.kt b/android/app/src/main/java/tv/orbit/classic/FilmIdentity.kt index 93770139..908c01e4 100644 --- a/android/app/src/main/java/tv/orbit/classic/FilmIdentity.kt +++ b/android/app/src/main/java/tv/orbit/classic/FilmIdentity.kt @@ -14,8 +14,8 @@ internal data class FilmIdentity(val title: String, val year: Int? = null, val i private val withYear = Regex("""^(.*\S)\s+\((\d{4})\)$""") fun of(entry: String): FilmIdentity { val trimmed = entry.trim() - val match = withYear.matchEntire(trimmed) ?: return FilmIdentity(trimmed, imdb = FilmImdb[trimmed] ?: OutlawImdb[trimmed] ?: NewChannelImdb[trimmed] ?: AtlasImdb[trimmed] ?: PunchlineImdb[trimmed] ?: SyndicateImdb[trimmed] ?: WonderImdb[trimmed]) - return FilmIdentity(match.groupValues[1], match.groupValues[2].toInt(), FilmImdb[trimmed] ?: OutlawImdb[trimmed] ?: NewChannelImdb[trimmed] ?: AtlasImdb[trimmed] ?: PunchlineImdb[trimmed] ?: SyndicateImdb[trimmed] ?: WonderImdb[trimmed]) + val match = withYear.matchEntire(trimmed) ?: return FilmIdentity(trimmed, imdb = FilmImdb[trimmed] ?: OutlawImdb[trimmed] ?: NewChannelImdb[trimmed] ?: AtlasImdb[trimmed] ?: PunchlineImdb[trimmed] ?: SyndicateImdb[trimmed] ?: WonderImdb[trimmed] ?: WonderTvImdb[trimmed]) + return FilmIdentity(match.groupValues[1], match.groupValues[2].toInt(), FilmImdb[trimmed] ?: OutlawImdb[trimmed] ?: NewChannelImdb[trimmed] ?: AtlasImdb[trimmed] ?: PunchlineImdb[trimmed] ?: SyndicateImdb[trimmed] ?: WonderImdb[trimmed] ?: WonderTvImdb[trimmed]) } } } diff --git a/android/app/src/main/java/tv/orbit/classic/Idents.kt b/android/app/src/main/java/tv/orbit/classic/Idents.kt index 0bb35595..9192c200 100644 --- a/android/app/src/main/java/tv/orbit/classic/Idents.kt +++ b/android/app/src/main/java/tv/orbit/classic/Idents.kt @@ -37,7 +37,7 @@ private const val IDENT_SHORTEST_PROGRAMME_MS = 3 * 60_000L private val IdentVideos = mapOf(ATLAS_NUMBER to R.raw.ident_113, SYNDICATE_NUMBER to R.raw.ident_114, PUNCHLINE_NUMBER to R.raw.ident_314, AMERICANA_NUMBER to R.raw.ident_111, OUTLAW_NUMBER to R.raw.ident_311, STORIES_NUMBER to R.raw.ident_112, SILVER_SCREEN_NUMBER to R.raw.ident_312, FRONTLINE_NUMBER to R.raw.ident_313, 108 to R.raw.ident_108, 109 to R.raw.ident_109, 110 to R.raw.ident_110, CHRISTMAS_NUMBER to R.raw.ident_310, 205 to R.raw.ident_205, 206 to R.raw.ident_206, 101 to R.raw.ident_101, 102 to R.raw.ident_102, 103 to R.raw.ident_103, 104 to R.raw.ident_104, 105 to R.raw.ident_105, 106 to R.raw.ident_106, 107 to R.raw.ident_107, 201 to R.raw.ident_201, 202 to R.raw.ident_202, 203 to R.raw.ident_203, 204 to R.raw.ident_204, 301 to R.raw.ident_301, 302 to R.raw.ident_302, 303 to R.raw.ident_303, 304 to R.raw.ident_304, 305 to R.raw.ident_305, 306 to R.raw.ident_306, 307 to R.raw.ident_307, 308 to R.raw.ident_308, 309 to R.raw.ident_309, 401 to R.raw.ident_401, 601 to R.raw.ident_601, 602 to R.raw.ident_602, 603 to R.raw.ident_603, 604 to R.raw.ident_604, 605 to R.raw.ident_605, - 611 to R.raw.ident_611, 612 to R.raw.ident_612, 613 to R.raw.ident_613) + 611 to R.raw.ident_611, 612 to R.raw.ident_612, 613 to R.raw.ident_613, WONDER_TV_NUMBER to R.raw.ident_615) /** [atMs] is when the next programme starts, for a channel whose ident follows the time of day. */ /** diff --git a/android/app/src/main/java/tv/orbit/classic/WonderTv.kt b/android/app/src/main/java/tv/orbit/classic/WonderTv.kt new file mode 100644 index 00000000..a006099d --- /dev/null +++ b/android/app/src/main/java/tv/orbit/classic/WonderTv.kt @@ -0,0 +1,218 @@ +package tv.orbit.classic + +/** + * Wonder TV (Paul, 30 November 2026): live-action family television: classic Nickelodeon and Disney Channel nostalgia, + * after-school favourites and original TV movies. Wonder's sister: Wonder is magical films and storybook animation; Wonder TV + * is live-action family sitcoms, tween adventures, studio shows and television movies. + * + * From the read-only audit (audit-20261130-wondertv, the doc "Wonder TV audit"): 83 series and 98 TV movies, all in English, + * rated for family viewing and on no other channel (Lizzie McGuire, Kenan & Kel, The Brady Bunch and Are You Afraid of the + * Dark? keep their homes). The game and studio shows run in Classics until their own events are approved; the events + * themselves (Friday Premiere Night, Saturday marathons, Sunday Showdown) wait until the everyday schedule has run cleanly. + * + * Featured, 19:00 to 21:00: a TV movie on Monday, Wednesday, Friday and Sunday evenings, serialised shows on the others; one + * film a night at most, and the rest of the slot goes to serialised shows and sitcoms, so a short film never leaves a gap. Films rest a week + * here and five days across the network. Halloween films play only in October's Featured, Christmas ones only in December's. + */ +internal const val WONDER_TV_NUMBER = 615 +/** A TV movie rests a week here (Paul, 30 November 2026), and five days across the network. */ +internal const val WONDER_TV_FILM_REST_MS = 7 * 24 * 60 * 60_000L + +/** Every series, in the audit's order. */ +internal val WonderTvShows = listOf( + "You Can't Do That on Television", "Mr. Wizard's World", "Clarissa Explains It All", "Legends of the Hidden Temple", + "The Adventures of Pete & Pete", "All That", "The Famous Jett Jackson", "So Weird", "The Amanda Show", "Even Stevens", "That's So Raven", + "Drake & Josh", "Ned's Declassified School Survival Guide", "The Suite Life of Zack & Cody", "Zoey 101", "Hannah Montana", + "Wizards of Waverly Place", "iCarly", "The Suite Life on Deck", "True Jackson, VP", "Big Time Rush", "Jonas", "Sonny with a Chance", + "Good Luck Charlie", "Shake It Up", "Victorious", "A.N.T. Farm", "Jessie", "House of Anubis", "How to Rock", "Deadtime Stories", + "Lab Rats (2012)", "Mighty Med", "Liv and Maddie", "Sam & Cat", "The Thundermans", "Alien Dawn", "Girl Meets World", "Henry Danger", + "Nicky, Ricky, Dicky & Dawn", "I Didn't Do It (2014)", "K.C. Undercover", "Bunk'd", "100 Things to Do Before High School", "Game Shakers", + "Best Friends Whenever", "Gamer's Guide to Pretty Much Everything", "Stuck in the Middle", "MECH-X4", "The HALO Effect", + "The Other Kingdom", "The Lodge", "Raven's Home", "Find Me in Paris", "Coop and Cami Ask the World", "Cousins for Life", + "Are You Afraid of the Dark? (2019)", "Sydney to the Max", "Pup Academy", "The Astronauts", "Danger Force", "That Girl Lay Lay", + "Eye Wonder", "Secrets of Sulphur Springs", "Drama Club", "The Really Loud House", "Ultra Violet & Black Scorpion", + "The Villains of Valley View", "Erin & Aaron", "Saturdays", "Electric Bloom", "The Thundermans: Undercover", "Vampirina: Teenage Vampire", + "Locker Diaries: ZOMBIES", "Crashletes", "Double Dare (2018)", "Are You Smarter Than a 5th Grader? (2019)", "The Substitute (2019)", + "Top Elf", "Disney Fam Jam", "High School Musical: The Musical: The Series", "Big Shot", "Degrassi Junior High") + +/** Breakfast Club, 06:00 to 09:00: lighter sitcoms, recent first. */ +private val WonderTvBreakfast = listOf( + "Bunk'd", "Raven's Home", "Sydney to the Max", "Coop and Cami Ask the World", "Stuck in the Middle", "Liv and Maddie", "Girl Meets World", + "Danger Force", "That Girl Lay Lay", "The Really Loud House", "Henry Danger", "The Thundermans", "Game Shakers", + "Nicky, Ricky, Dicky & Dawn", "The Thundermans: Undercover", "Vampirina: Teenage Vampire", "Electric Bloom", "Big Shot") + +/** After School, 15:00 to 19:00, the signature block: the golden years. */ +private val WonderTvAfterSchool = listOf( + "That's So Raven", "Drake & Josh", "Ned's Declassified School Survival Guide", "The Suite Life of Zack & Cody", "The Suite Life on Deck", + "Zoey 101", "Hannah Montana", "Wizards of Waverly Place", "iCarly", "True Jackson, VP", "Sonny with a Chance", "Good Luck Charlie", + "Shake It Up", "Victorious", "Big Time Rush", "Jessie", "A.N.T. Farm", "Even Stevens", "Jonas", "Sam & Cat", "Lab Rats (2012)", + "Mighty Med", "K.C. Undercover", "Degrassi Junior High", "High School Musical: The Musical: The Series") + +/** Featured's serialised shows, on the nights a TV movie isn't on. */ +private val WonderTvSerial = listOf( + "House of Anubis", "So Weird", "Secrets of Sulphur Springs", "The Other Kingdom", "Find Me in Paris", "Are You Afraid of the Dark? (2019)", + "The Lodge", "Alien Dawn", "The Astronauts") + +/** Late Night Re-runs' longer runs of the classics, for grown-up nostalgia. */ +private val WonderTvClassicNick = listOf( + "You Can't Do That on Television", "Mr. Wizard's World", "Clarissa Explains It All", "The Adventures of Pete & Pete", "All That", + "The Amanda Show", "So Weird", "The Famous Jett Jackson", "Even Stevens") + +/** The everyday TV movies. */ +private val WonderTvFilmsEveryday = listOf( + "Blank Check (1994)", "Brink! (1998)", "Johnny Tsunami (1999)", "Smart House (1999)", "Zenon: Girl of the 21st Century (1999)", + "Can of Worms (1999)", "Alley Cats Strike (2000)", "Phantom of the Megaplex (2000)", "The Color of Friendship (2000)", + "Stepsister from Planet Weird (2000)", "Quints (2000)", "Up, Up, and Away (2000)", "Two Heads Are Better Than None (2000)", + "Zenon: The Zequel (2001)", "Motocrossed! (2001)", "Jett Jackson: The Movie (2001)", "Jumping Ship (2001)", "Cadet Kelly (2002)", + "A Ring of Endless Light (2002)", "Double Teamed! (2002)", "The Cheetah Girls (2003)", "The Even Stevens Movie (2003)", + "Eddie's Million Dollar Cook Off (2003)", "Pixel Perfect (2004)", "Stuck in the Suburbs (2004)", "Tiger Cruise (2004)", "Zenon: Z3 (2004)", + "Go Figure (2005)", "Now You See It... (2005)", "High School Musical (2006)", "Wendy Wu: Homecoming Warrior (2006)", + "That's So Suite Life of Hannah Montana (2006)", "Read It and Weep (2006)", "Drake & Josh Go Hollywood (2006)", + "High School Musical 2 (2007)", "Jump In! (2007)", "Shredderman Rules (2007)", "Johnny Kapahala: Back on Board (2007)", "Camp Rock (2008)", + "The Cheetah Girls: One World (2008)", "The Last Day of Summer (2008)", "Gym Teacher: The Movie (2008)", "iCarly: iGo to Japan (2008)", + "Princess Protection Program (2009)", "Wizards of Waverly Place: The Movie (2009)", "Hannah Montana: The Movie (2009)", + "Hatching Pete (2009)", "Dadnapped (2009)", "16 Wishes (2010)", "Camp Rock 2: The Final Jam (2010)", "Starstruck (2010)", + "Avalon High (2011)", "Lemonade Mouth (2011)", "The Suite Life Movie (2011)", "Fred 2: Night of the Living Fred (2011)", + "iParty with Victorious (2011)", "Big Time Movie (2012)", "FRED 3: Camp Fred (2012)", "Rags (2012)", "Teen Beach Movie (2013)", + "Descendants (2015)", "Invisible Sister (2015)", "Splitting Adam (2015)", "One Crazy Cruise (2015)", + "Descendants 2 (2017)", "Escape from Mr. Lemoncello's Library (2017)", "Freaky Friday (2018)", "Descendants 3 (2019)", + "Upside-Down Magic (2020)", "The J Team (2021)", "Spin (2021)", "Sneakerella (2022)", "Zombies 3 (2022)", "Fantasy Football (2022)", + "Monster High: The Movie (2022)", "Good Burger 2 (2023)", "Monster High 2 (2023)", "Descendants: The Rise of Red (2024)", + "The Thundermans Return (2024)", "Henry Danger: The Movie (2025)", "Dora and the Search for Sol Dorado (2025)", "Camp Rock 3 (2026)") + +/** Halloween's TV movies: October's Featured only. */ +private val WonderTvHalloween = listOf( + "Under Wraps (1997)", "Halloweentown (1998)", "Don't Look Under the Bed (1999)", "Cry Baby Lane (2000)", + "Halloweentown II: Kalabar's Revenge (2001)", "Twitches (2005)", "Twitches Too (2007)", "The Boy Who Cried Werewolf (2010)", + "Girl vs. Monster (2012)", "A Really Haunted Loud House (2023)") + +/** Christmas TV movies: December's Featured only. */ +private val WonderTvChristmas = listOf( + "'Twas the Night (2001)", "Merry Christmas, Drake & Josh (2008)", "Santa Hunters (2014)", "Tiny Christmas (2017)", + "A Loud House Christmas (2021)") + +/** Every TV movie: the films this series channel reads ([ChannelProgramming.channelFilms]). */ +internal val WonderTvFilms get() = WonderTvFilmsEveryday + WonderTvHalloween + WonderTvChristmas + +/** Every series core, so the channel rotates by weight (the films count as supporting). */ +internal val WonderTvTiers: Map get() = WonderTvShows.associate { seriesKey(it) to TIER_CORE } + +/** Featured's film nights: a TV movie on four evenings a week; the other three are serialised shows. */ +internal val WonderTvFilmNights = setOf(java.time.DayOfWeek.MONDAY, java.time.DayOfWeek.WEDNESDAY, java.time.DayOfWeek.FRIDAY, java.time.DayOfWeek.SUNDAY) + +internal val WonderTvDayParts: List get() { + val sitcoms = WonderTvAfterSchool + WonderTvBreakfast + fun movie(films: List, months: Set) = + DayPart(19, 21, films, group = "Featured", days = WonderTvFilmNights, once = true, key = "wondertv.featured", months = months) + return listOf( + // In their month the seasonal films come first in the turn; when they're all resting, the night takes an everyday one. + movie(WonderTvHalloween, setOf(java.time.Month.OCTOBER)), + movie(WonderTvChristmas, setOf(java.time.Month.DECEMBER)), + movie(WonderTvFilmsEveryday, java.time.Month.values().toSet() - setOf(java.time.Month.OCTOBER, java.time.Month.DECEMBER)), + // The other nights, and the rest of a film night once its film has started: serialised shows, then sitcoms. + DayPart(19, 21, WonderTvSerial + sitcoms, group = "Featured", key = "wondertv.featured"), + DayPart(6, 9, WonderTvBreakfast, group = "Breakfast Club", key = "wondertv.breakfast"), + DayPart(9, 15, WonderTvShows - setOf("Degrassi Junior High"), group = "Classics", key = "wondertv.classics"), + DayPart(15, 19, WonderTvAfterSchool, group = "After School", key = "wondertv.afterschool"), + DayPart(21, 6, WonderTvClassicNick + WonderTvAfterSchool, group = "Late Night Re-runs", key = "wondertv.late")) +} + +/** Each TV movie by its year and IMDb ID, from the library's own copies. */ +internal val WonderTvImdb: Map by lazy { mapOf( + "Blank Check (1994)" to "tt0109287", + "Under Wraps (1997)" to "tt0128801", + "Brink! (1998)" to "tt0162212", + "Halloweentown (1998)" to "tt0173886", + "Johnny Tsunami (1999)" to "tt0206064", + "Smart House (1999)" to "tt0192618", + "Zenon: Girl of the 21st Century (1999)" to "tt0186726", + "Don't Look Under the Bed (1999)" to "tt0208101", + "Can of Worms (1999)" to "tt0186910", + "Alley Cats Strike (2000)" to "tt0217990", + "Phantom of the Megaplex (2000)" to "tt0266850", + "The Color of Friendship (2000)" to "tt0213565", + "Cry Baby Lane (2000)" to "tt0221097", + "Stepsister from Planet Weird (2000)" to "tt0250754", + "Quints (2000)" to "tt0245380", + "Up, Up, and Away (2000)" to "tt0211174", + "Two Heads Are Better Than None (2000)" to "tt0235512", + "Halloweentown II: Kalabar's Revenge (2001)" to "tt0274761", + "Zenon: The Zequel (2001)" to "tt0271271", + "Motocrossed! (2001)" to "tt0273842", + "'Twas the Night (2001)" to "tt0282223", + "Jett Jackson: The Movie (2001)" to "tt0272606", + "Jumping Ship (2001)" to "tt0271172", + "Cadet Kelly (2002)" to "tt0294425", + "A Ring of Endless Light (2002)" to "tt0282123", + "Double Teamed! (2002)" to "tt0281905", + "The Cheetah Girls (2003)" to "tt0338852", + "The Even Stevens Movie (2003)" to "tt0327698", + "Eddie's Million Dollar Cook Off (2003)" to "tt0365149", + "Pixel Perfect (2004)" to "tt0393596", + "Stuck in the Suburbs (2004)" to "tt0410696", + "Tiger Cruise (2004)" to "tt0397113", + "Zenon: Z3 (2004)" to "tt0379060", + "Go Figure (2005)" to "tt0447987", + "Twitches (2005)" to "tt0467421", + "Now You See It... (2005)" to "tt0426568", + "High School Musical (2006)" to "tt0475293", + "Wendy Wu: Homecoming Warrior (2006)" to "tt0790781", + "That's So Suite Life of Hannah Montana (2006)" to "tt1478329", + "Read It and Weep (2006)" to "tt0494716", + "Drake & Josh Go Hollywood (2006)" to "tt0492878", + "High School Musical 2 (2007)" to "tt0810900", + "Jump In! (2007)" to "tt0805559", + "Twitches Too (2007)" to "tt1017465", + "Shredderman Rules (2007)" to "tt0828450", + "Johnny Kapahala: Back on Board (2007)" to "tt0942378", + "Camp Rock (2008)" to "tt1055366", + "The Cheetah Girls: One World (2008)" to "tt1013542", + "The Last Day of Summer (2008)" to "tt0859622", + "Gym Teacher: The Movie (2008)" to "tt1167490", + "iCarly: iGo to Japan (2008)" to "tt1286124", + "Merry Christmas, Drake & Josh (2008)" to "tt1249300", + "Princess Protection Program (2009)" to "tt1196339", + "Wizards of Waverly Place: The Movie (2009)" to "tt1369845", + "Hannah Montana: The Movie (2009)" to "tt1114677", + "Hatching Pete (2009)" to "tt1222818", + "Dadnapped (2009)" to "tt1090750", + "16 Wishes (2010)" to "tt1646876", + "Camp Rock 2: The Final Jam (2010)" to "tt1252380", + "Starstruck (2010)" to "tt1579247", + "The Boy Who Cried Werewolf (2010)" to "tt1451423", + "Avalon High (2011)" to "tt1614950", + "Lemonade Mouth (2011)" to "tt1648204", + "The Suite Life Movie (2011)" to "tt1754799", + "Fred 2: Night of the Living Fred (2011)" to "tt1927093", + "iParty with Victorious (2011)" to "tt1857596", + "Big Time Movie (2012)" to "tt2163203", + "Girl vs. Monster (2012)" to "tt2326087", + "FRED 3: Camp Fred (2012)" to "tt2395219", + "Rags (2012)" to "tt1910605", + "Teen Beach Movie (2013)" to "tt2325989", + "Santa Hunters (2014)" to "tt3511012", + "Descendants (2015)" to "tt3440298", + "Invisible Sister (2015)" to "tt4420110", + "Splitting Adam (2015)" to "tt3712822", + "One Crazy Cruise (2015)" to "tt4058572", + "Descendants 2 (2017)" to "tt5117876", + "Escape from Mr. Lemoncello's Library (2017)" to "tt5878476", + "Tiny Christmas (2017)" to "tt6727816", + "Freaky Friday (2018)" to "tt7631348", + "Descendants 3 (2019)" to "tt8022928", + "Upside-Down Magic (2020)" to "tt10833270", + "The J Team (2021)" to "tt14006530", + "Spin (2021)" to "tt12969826", + "A Loud House Christmas (2021)" to "tt11947282", + "Sneakerella (2022)" to "tt10160886", + "Zombies 3 (2022)" to "tt14301252", + "Fantasy Football (2022)" to "tt15035506", + "Monster High: The Movie (2022)" to "tt1447981", + "A Really Haunted Loud House (2023)" to "tt27428598", + "Good Burger 2 (2023)" to "tt25289836", + "Monster High 2 (2023)" to "tt23026954", + "Descendants: The Rise of Red (2024)" to "tt20202136", + "The Thundermans Return (2024)" to "tt26943420", + "Henry Danger: The Movie (2025)" to "tt7787524", + "Dora and the Search for Sol Dorado (2025)" to "tt32621553", + "Camp Rock 3 (2026)" to "tt6743524") } diff --git a/android/app/src/main/res/drawable-nodpi/orbit_wonder_tv_bug.webp b/android/app/src/main/res/drawable-nodpi/orbit_wonder_tv_bug.webp new file mode 100644 index 00000000..7245eb3b Binary files /dev/null and b/android/app/src/main/res/drawable-nodpi/orbit_wonder_tv_bug.webp differ diff --git a/android/app/src/main/res/drawable-nodpi/orbit_wonder_tv_epg.webp b/android/app/src/main/res/drawable-nodpi/orbit_wonder_tv_epg.webp new file mode 100644 index 00000000..cb40cfe7 Binary files /dev/null and b/android/app/src/main/res/drawable-nodpi/orbit_wonder_tv_epg.webp differ diff --git a/android/app/src/main/res/raw/block_wondertv_afterschool.mp4 b/android/app/src/main/res/raw/block_wondertv_afterschool.mp4 new file mode 100644 index 00000000..da43df20 Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_afterschool.mp4 differ diff --git a/android/app/src/main/res/raw/block_wondertv_afterschool_sting.m4a b/android/app/src/main/res/raw/block_wondertv_afterschool_sting.m4a new file mode 100644 index 00000000..1dd85a96 Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_afterschool_sting.m4a differ diff --git a/android/app/src/main/res/raw/block_wondertv_breakfast.mp4 b/android/app/src/main/res/raw/block_wondertv_breakfast.mp4 new file mode 100644 index 00000000..57817d42 Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_breakfast.mp4 differ diff --git a/android/app/src/main/res/raw/block_wondertv_breakfast_sting.m4a b/android/app/src/main/res/raw/block_wondertv_breakfast_sting.m4a new file mode 100644 index 00000000..1dd85a96 Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_breakfast_sting.m4a differ diff --git a/android/app/src/main/res/raw/block_wondertv_classics.mp4 b/android/app/src/main/res/raw/block_wondertv_classics.mp4 new file mode 100644 index 00000000..d473ba0c Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_classics.mp4 differ diff --git a/android/app/src/main/res/raw/block_wondertv_classics_sting.m4a b/android/app/src/main/res/raw/block_wondertv_classics_sting.m4a new file mode 100644 index 00000000..1dd85a96 Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_classics_sting.m4a differ diff --git a/android/app/src/main/res/raw/block_wondertv_featured.mp4 b/android/app/src/main/res/raw/block_wondertv_featured.mp4 new file mode 100644 index 00000000..4369edb6 Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_featured.mp4 differ diff --git a/android/app/src/main/res/raw/block_wondertv_featured_sting.m4a b/android/app/src/main/res/raw/block_wondertv_featured_sting.m4a new file mode 100644 index 00000000..1dd85a96 Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_featured_sting.m4a differ diff --git a/android/app/src/main/res/raw/block_wondertv_late.mp4 b/android/app/src/main/res/raw/block_wondertv_late.mp4 new file mode 100644 index 00000000..a4e1cf9d Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_late.mp4 differ diff --git a/android/app/src/main/res/raw/block_wondertv_late_sting.m4a b/android/app/src/main/res/raw/block_wondertv_late_sting.m4a new file mode 100644 index 00000000..1dd85a96 Binary files /dev/null and b/android/app/src/main/res/raw/block_wondertv_late_sting.m4a differ diff --git a/android/app/src/main/res/raw/ident_615.mp4 b/android/app/src/main/res/raw/ident_615.mp4 new file mode 100644 index 00000000..2b4ceb07 Binary files /dev/null and b/android/app/src/main/res/raw/ident_615.mp4 differ diff --git a/android/app/src/test/java/tv/orbit/classic/ChannelPresetsTest.kt b/android/app/src/test/java/tv/orbit/classic/ChannelPresetsTest.kt index 360ea044..26956481 100644 --- a/android/app/src/test/java/tv/orbit/classic/ChannelPresetsTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/ChannelPresetsTest.kt @@ -169,7 +169,7 @@ class ChannelPresetsTest { // Kitchen, Home and Play joined on 6 November 2026. // Americana, OUTLAW, Orbit Stories, Silver Screen and Frontline joined on 23 November 2026; ATLAS on 24 November; // SYNDICATE and PUNCHLINE on 25 November. - assertEquals(44, SmartChannels.size) + assertEquals(45, SmartChannels.size) } @Test fun ringXKeepsItsWeeknightsAndFallsBackToTheVault() { @@ -200,7 +200,7 @@ class ChannelPresetsTest { @Test fun everySmartChannelIsBrandedAndNumberedAfterTheMove() { SmartChannels.forEach { assertNotNull("${it.name} has no brand at ${it.number}", ChannelBrands.forNumber(it.number)) } - assertEquals(OldChannelNumbers.values.toSet() - DRIVE_IN_NUMBER + 101 + TOTS_NUMBER + setOf(108, 109, 110, 205, 206, CHRISTMAS_NUMBER, AMERICANA_NUMBER, OUTLAW_NUMBER, STORIES_NUMBER, SILVER_SCREEN_NUMBER, FRONTLINE_NUMBER, ATLAS_NUMBER, SYNDICATE_NUMBER, PUNCHLINE_NUMBER), SmartChannels.map { it.number }.toSet()) + assertEquals(OldChannelNumbers.values.toSet() - DRIVE_IN_NUMBER + 101 + TOTS_NUMBER + setOf(108, 109, 110, 205, 206, CHRISTMAS_NUMBER, AMERICANA_NUMBER, OUTLAW_NUMBER, STORIES_NUMBER, SILVER_SCREEN_NUMBER, FRONTLINE_NUMBER, ATLAS_NUMBER, SYNDICATE_NUMBER, PUNCHLINE_NUMBER, WONDER_TV_NUMBER), SmartChannels.map { it.number }.toSet()) } @Test fun kitchenHomeAndPlayAreBrandedInTheirBlocks() { diff --git a/android/app/src/test/java/tv/orbit/classic/PpvSundayTest.kt b/android/app/src/test/java/tv/orbit/classic/PpvSundayTest.kt index bd3cf342..b1a3042d 100644 --- a/android/app/src/test/java/tv/orbit/classic/PpvSundayTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/PpvSundayTest.kt @@ -87,7 +87,8 @@ class PpvSundayTest { @Test fun onlyRingXAndAtlasCarryFilmsInAnEvent() { // ATLAS (24 November 2026): its film events, from its own list. // SYNDICATE (25 November 2026): films in its everyday blocks and events, from its own list. - assertEquals(listOf(ATLAS_NUMBER, SYNDICATE_NUMBER, 401), SmartChannels.filter { it.channelFilms.isNotEmpty() }.map { it.number }.sorted()) + // Wonder TV (30 November 2026): its TV movies in Featured. + assertEquals(listOf(ATLAS_NUMBER, SYNDICATE_NUMBER, 401, WONDER_TV_NUMBER), SmartChannels.filter { it.channelFilms.isNotEmpty() }.map { it.number }.sorted()) } @Test fun ringXReadsItsEventsAgainWhenTheListChanges() { diff --git a/android/app/src/test/java/tv/orbit/classic/PresentationTest.kt b/android/app/src/test/java/tv/orbit/classic/PresentationTest.kt index 4f80c018..0485fb61 100644 --- a/android/app/src/test/java/tv/orbit/classic/PresentationTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/PresentationTest.kt @@ -23,8 +23,8 @@ class PresentationTest { // and Saturday Mornings on Heroes, Orbit X and Rewind. // OUTLAW's After Sundown joined on 23 November 2026; Frontline's Cost of War, Hitchcock Nights and Stories' After Hours on the 24th. // ATLAS's five dayparts and four film events on the 25th; then PUNCHLINE's five blocks and four events, and SYNDICATE's six - // blocks and four events. - assertEquals(39 + 9 + 10, keys.size) + // blocks and four events; Wonder TV's five blocks on the 30th. + assertEquals(39 + 9 + 10 + 5, keys.size) assertEquals(emptySet(), keys - BlockIdents.keys) assertTrue(keys.all { PRESENTATION_KEY.matches(it) }) } diff --git a/android/app/src/test/java/tv/orbit/classic/SpecialEventsTest.kt b/android/app/src/test/java/tv/orbit/classic/SpecialEventsTest.kt index 046aa551..48812f62 100644 --- a/android/app/src/test/java/tv/orbit/classic/SpecialEventsTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/SpecialEventsTest.kt @@ -20,7 +20,8 @@ class SpecialEventsTest { expected.forEach { (n, part) -> assertEquals("channel $n ${part.key}${part.group}", 1, held.count { it.first == n && it.second === part }) } assertEquals(expected.size, held.size) // 55 before PUNCHLINE's 13 and SYNDICATE's 5 (Paul, 25 November 2026). - assertEquals(55 + 13 + 5, held.size) + // Wonder TV's Featured film nights (30 November 2026): three, one for October, one for December, one for the rest. + assertEquals(55 + 13 + 5 + 3, held.size) } @Test fun everyTakeoverIsThereExactlyOnce() { @@ -37,7 +38,7 @@ class SpecialEventsTest { } @Test fun stageAAddsNothingAndEverythingIsApproved() { - assertEquals(55 + 13 + 5 + 4 + 18, all.size) + assertEquals(55 + 13 + 5 + 3 + 4 + 18, all.size) assertTrue(all.all { it.status == SpecialStatus.Approved }) } diff --git a/android/app/src/test/java/tv/orbit/classic/WeightedRotationTest.kt b/android/app/src/test/java/tv/orbit/classic/WeightedRotationTest.kt index 3cd759ad..2374bc36 100644 --- a/android/app/src/test/java/tv/orbit/classic/WeightedRotationTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/WeightedRotationTest.kt @@ -190,7 +190,7 @@ class WeightedRotationTest { } @Test fun theApprovedChannelsAreWeightedAndTotsBedtimeIsNot() { - assertEquals(listOf(101, 102, 103, 104, 106, 107, 108, 112, ATLAS_NUMBER, SYNDICATE_NUMBER, 202, 203, 204, 601, 602, 603, 604, 605, 614), SmartChannels.filter { it.tierWeights != null }.map { it.number }.sorted()) + assertEquals(listOf(101, 102, 103, 104, 106, 107, 108, 112, ATLAS_NUMBER, SYNDICATE_NUMBER, 202, 203, 204, 601, 602, 603, 604, 605, 614, WONDER_TV_NUMBER), SmartChannels.filter { it.tierWeights != null }.map { it.number }.sorted()) // Riot, Terra, Ring X and Junior keep equal turns. assertTrue(SmartChannels.filter { it.number in setOf(105, 201, 401, 611) }.all { it.tierWeights == null }) assertEquals(setOf(103, 202, 204, 601, 604, 605, 614, SYNDICATE_NUMBER), SmartChannels.filter { it.catalogueScaleHours != null }.map { it.number }.toSet()) diff --git a/android/app/src/test/java/tv/orbit/classic/WonderTvChannelTest.kt b/android/app/src/test/java/tv/orbit/classic/WonderTvChannelTest.kt new file mode 100644 index 00000000..2539587a --- /dev/null +++ b/android/app/src/test/java/tv/orbit/classic/WonderTvChannelTest.kt @@ -0,0 +1,38 @@ +package tv.orbit.classic + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +/** Wonder TV (Paul, 30 November 2026): its list, its blocks and its homes. */ +class WonderTvChannelTest { + private val p = SmartChannels.first { it.number == WONDER_TV_NUMBER } + + @Test fun itsListAndFilms() { + assertEquals("Wonder TV", p.name) + assertEquals(83, p.searches.size) + assertEquals(97, p.channelFilms.size) + assertTrue(p.channelFilms.all { FilmIdentity.of(it).year != null && FilmIdentity.of(it).imdb?.startsWith("tt") == true }) + listOf("High School Musical: The Musical: The Series", "Big Shot", "Degrassi Junior High").forEach { assertTrue(it, it in p.searches) } + assertEquals(ChannelCategory.Kids, ChannelBrands.forNumber(WONDER_TV_NUMBER)!!.category) + } + + @Test fun existingHomesAreKept() { + val elsewhere = SmartChannels.filter { it.number != WONDER_TV_NUMBER }.flatMap { it.searches + it.filmSeries + it.channelFilms }.map { seriesKey(FilmIdentity.of(it).label) }.toSet() + (p.searches + p.channelFilms).forEach { assertFalse(it, seriesKey(FilmIdentity.of(it).label) in elsewhere) } + listOf("Lizzie McGuire", "Kenan & Kel", "The Brady Bunch", "Riverdale", "90210").forEach { assertFalse(it, it in p.searches) } + } + + @Test fun filmsOnlyOnFilmNightsAndSeasonalOnlyInTheirMonth() { + val films = p.dayParts.filter { part -> part.titles.any { it in p.channelFilms } } + assertTrue(films.all { it.fromHour == 19 && it.toHour == 21 && it.once && it.days == WonderTvFilmNights }) + val october = films.first { java.time.Month.OCTOBER in it.months }; val december = films.first { java.time.Month.DECEMBER in it.months } + assertTrue(october.titles.any { it.startsWith("Halloweentown") } && october.titles.none { it.startsWith("Tiny Christmas") }) + assertTrue(december.titles.any { it.startsWith("Tiny Christmas") } && december.titles.none { it.startsWith("Halloweentown") }) + val rest = films.first { java.time.Month.MARCH in it.months } + assertTrue(rest.titles.none { it.startsWith("Halloweentown") || it.startsWith("Tiny Christmas") }) + // Degrassi Junior High plays after school and late, never in the morning or daytime classics. + assertTrue(p.dayParts.filter { it.fromHour in 6..14 }.none { "Degrassi Junior High" in it.titles }) + } +} diff --git a/android/app/src/test/java/tv/orbit/classic/WonderTvSimulationTest.kt b/android/app/src/test/java/tv/orbit/classic/WonderTvSimulationTest.kt new file mode 100644 index 00000000..2b4aaaa0 --- /dev/null +++ b/android/app/src/test/java/tv/orbit/classic/WonderTvSimulationTest.kt @@ -0,0 +1,86 @@ +package tv.orbit.classic + +import org.json.JSONArray +import org.json.JSONObject +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Assume.assumeTrue +import org.junit.Test +import java.io.File +import java.time.Instant +import java.time.ZoneId + +/** + * Wonder TV's read-only simulation (Paul, 30 November 2026): planned from a fixed start, topped up daily for five weeks, from + * the audit's series (their episode counts, at 22 minutes) and TV movies (their real lengths), against a TV snapshot's other + * plans with the same clash and network-rest rules the box uses. Run from 1 October and 30 November, so October's and + * December's films come round. Env: SIM_SNAP, SIM_WONDERTV (candidates.json), SIM_OUT. + */ +class WonderTvSimulationTest { + @Test fun simulate() { + val dir = System.getenv("SIM_SNAP")?.let(::File); val src = System.getenv("SIM_WONDERTV")?.let(::File) + assumeTrue(dir != null && dir.isDirectory && src != null && src.exists()) + val out = File(System.getenv("SIM_OUT")!!).also { it.mkdirs() } + val zone = ZoneId.of("Europe/London") + val user = dir!!.listFiles()!!.first { it.name.startsWith("schedule-") }.let { JSONObject(it.readText()).getString("user") } + val store = ScheduleStore(dir) + val p = SmartChannels.first { it.number == WONDER_TV_NUMBER } + val rows = JSONArray(src!!.readText()).let { a -> (0 until a.length()).map { a.getJSONObject(it) } } + val byTitle = rows.associateBy { seriesKey(it.getString("title").trim()) } + val series = p.searches.mapNotNull { t -> + val o = byTitle[seriesKey(t)] ?: return@mapNotNull null + val n = o.optInt("episodes", 0).takeIf { it > 0 } ?: return@mapNotNull null + PoolSeries(o.getString("id"), t, (1..n).map { e -> PoolEpisode("${o.getString("id")}$e", "9${o.getString("id")}$e", EpisodeMark(1, e), "$t / S1 E$e", 22 * 60_000L) }) + } + val films = p.channelFilms.mapNotNull { entry -> + val id = FilmIdentity.of(entry) + val o = rows.firstOrNull { it.getString("type") == "Movie" && seriesKey(it.getString("title").trim()) == seriesKey(id.title) && it.optInt("year") == id.year } ?: return@mapNotNull null + PoolSeries(o.getString("id"), o.getString("title").trim(), listOf(PoolEpisode(o.getString("id"), "9" + o.getString("id"), EpisodeMark(1, 1), o.getString("title"), o.getInt("minutes") * 60_000L)), + ref = "imdb." + o.optString("imdb"), year = id.year) + } + val pool = series + films + val others = (SmartChannels.map { it.number } - setOf(WONDER_TV_NUMBER) + DRIVE_IN_NUMBER).mapNotNull { n -> store.loadPlan(user, n)?.let { n to it } }.toMap() + val clash = clashesWithAirings(others.values.flatMap { airingsOf(it) }) + val resting = restingElsewhere(others.values.flatMap { filmAiringsOf(it) }) + val avoid: ProgrammeClash = { show, s, e -> clash(show, s, e) || (show.isFilm && resting(show, s)) } + val report = StringBuilder("pool: ${series.size} series, ${films.size} films\n") + val seasonal = setOf("Halloweentown", "Twitches", "Under Wraps", "Don't Look Under the Bed", "The Boy Who Cried Werewolf", "Girl vs. Monster", "Cry Baby Lane", "A Really Haunted Loud House", + "'Twas the Night", "Tiny Christmas", "Santa Hunters", "Merry Christmas, Drake & Josh", "A Loud House Christmas") + val checks = mutableListOf() + for ((label, start) in listOf("october" to java.time.LocalDateTime.of(2026, 10, 1, 6, 0), "december" to java.time.LocalDateTime.of(2026, 11, 30, 6, 0))) { + val now = start.atZone(zone).toInstant().toEpochMilli() + val all = LinkedHashMap(); var plan: ChannelPlan? = null; var aired = ScheduleCursor() + for (day in 0 until 35) { + plan?.let { aired = airedCursor(aired, it.entries, now + day * 86_400_000L) } + plan = topUpPlan(plan, aired, pool, now + day * 86_400_000L, p.filmRestMs, p.finishTogether, p.dayParts, zone, avoid = avoid, shuffle = p.shuffleEpisodes, + mixed = p::mixes, weightOf = p.tierWeights?.let { p::weightOf }, adaptiveRest = p.adaptiveFilmRest, fileRestMs = p.fileRestMs, stories = p.storyGrouping, + shorts = p.shorts, marathon = p.marathon, network = NoNetworkRest)!! + plan.entries.forEach { all.putIfAbsent("${it.startMs}", it) } + } + val entries = all.values.sortedBy { it.startMs } + fun local(ms: Long) = Instant.ofEpochMilli(ms).atZone(zone) + val tsv = StringBuilder("start\tend\tminutes\ttitle\tblock\tfilm\n") + entries.forEach { e -> val show = pool.first { it.id == e.seriesId } + tsv.append("${local(e.startMs).toLocalDateTime()}\t${local(e.endMs).toLocalDateTime()}\t${(e.endMs - e.startMs) / 60_000}\t${e.media.item.title}\t${presentationOf(e, p.dayParts, zone)}\t${show.isFilm}\n") } + File(out, "plan-615-$label.tsv").writeText(tsv.toString()) + val filmEntries = entries.filter { e -> pool.first { it.id == e.seriesId }.isFilm } + val byNight = filmEntries.groupBy { local(it.startMs).toLocalDate() } + val outOfSlot = filmEntries.count { local(it.startMs).hour !in 19..20 } + val twoAnight = byNight.count { it.value.size > 1 } + val nights = entries.map { local(it.startMs).toLocalDate() }.toSet().size + val repeats = filmEntries.groupBy { it.seriesId }.values.filter { it.size > 1 }.map { l -> l.zipWithNext { a, b -> (b.startMs - a.startMs) / 86_400_000L }.minOrNull() ?: 0 } + val offSeason = filmEntries.filter { e -> seasonal.any { e.media.item.title.startsWith(it) } }.filter { e -> + val m = local(e.startMs).month; val christmas = listOf("'Twas", "Tiny Christmas", "Santa Hunters", "Merry Christmas", "A Loud House Christmas").any { e.media.item.title.startsWith(it) } + if (christmas) m != java.time.Month.DECEMBER else m != java.time.Month.OCTOBER } + val gaps = entries.zipWithNext().sumOf { (a, b) -> maxOf(0L, b.startMs - a.endMs) } / 60_000 + val clashes = entries.count { e -> clash(pool.first { it.id == e.seriesId }, e.startMs, e.endMs) } + report.append("$label: ${entries.size} programmes over $nights days; films ${filmEntries.size} on ${byNight.size} nights, two in a night ${twoAnight}, outside Featured $outOfSlot; " + + "shortest gap between a film's showings ${repeats.minOrNull() ?: "none repeated"} days; seasonal off-season $offSeason; gaps ${gaps} min; clashes $clashes\n") + byNight.filter { it.value.size > 1 }.forEach { (d, l) -> report.append(" two films $d: ${l.joinToString { "${local(it.startMs).toLocalTime()} ${it.media.item.title}" }}\n") } + filmEntries.filter { local(it.startMs).hour !in 19..20 }.forEach { report.append(" outside Featured: ${local(it.startMs)} ${it.media.item.title}\n") } + checks += listOf(twoAnight == 0, outOfSlot == 0, offSeason.isEmpty(), clashes == 0, (repeats.minOrNull() ?: 99) >= 7) + } + File(out, "summary.txt").writeText(report.toString()); println(report) + assertTrue(report.toString(), checks.all { it }) + } +}