Keep looking for a preset's shows until three have episodes (0.37.0)
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 1m47s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m27s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-01 23:42:35 +00:00
co-authored by Claude Opus 5.5
parent 2dc57df85f
commit daa3adbf71
8 changed files with 54 additions and 17 deletions
@@ -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)
}
}