Keep looking for a preset's shows until three have episodes (0.37.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,4 +70,16 @@ class ChannelPresetsTest {
|
||||
saved.getJSONArray("extra").getJSONObject(0).put("number", 999)
|
||||
assertThrows(Exception::class.java) { RememberedStateCodec.decode(saved.toString().toByteArray()) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun onlyTheFirstFiveRegularEpisodesAreKept() {
|
||||
val show = series("a", "Fixture")
|
||||
val episodes = listOf(EpisodeCandidate("s", "Special", 0, 1, 60_000)) + (8 downTo 1).map { EpisodeCandidate("e$it", "E$it", 1, it, 60_000) }
|
||||
assertEquals(listOf("e1", "e2", "e3", "e4", "e5"), regularEpisodes(listOf(SeriesEpisodes(show, episodes, false))).single().episodes.map { it.id })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aSearchWithoutTheFindsTheFullTitle() {
|
||||
assertEquals("a", bestSeriesMatch("X-Files", listOf(series("a", "The X-Files", 1993)))?.id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user