Tighten suggestion rules and request the fields they check (0.46.0 in testing)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -94,4 +94,24 @@ class ChannelSuggestionsTest {
|
||||
assertEquals(vortex.searches.size, vortex.searches.distinct().size)
|
||||
assertTrue(vortex.seriesCount >= vortex.searches.size)
|
||||
}
|
||||
|
||||
@Test fun theRequestAsksForEverythingTheRuleChecks() {
|
||||
val requests = mutableListOf<EmbyRequest>()
|
||||
findSuggestions(EmbyTransport { requests += it; EmbyReply(200, JSONObject().put("Items", JSONArray()).toString()) }, user, { "t" }, listOf(rule), emptySet(), emptySet())
|
||||
listOf("ProductionYear", "OfficialRating", "CommunityRating", "Genres", "MediaSources").forEach { assertTrue(requests.single().path.contains(it)) }
|
||||
}
|
||||
|
||||
@Test fun familyFilmsShortsAndBlockbustersAreLeftOut() {
|
||||
val strict = rule.copy(excludeGenres = setOf("Family", "Animation"), minMinutes = 70, maxRating = 7.9f)
|
||||
val rows = arrayOf(row("fits", "Fits", listOf("Horror", "Comedy")),
|
||||
row("family", "Family", listOf("Horror", "Comedy", "Family")),
|
||||
row("cartoon", "Cartoon", listOf("Horror", "Comedy", "Animation")),
|
||||
row("big", "Blockbuster", listOf("Horror", "Comedy"), rating = 8.6),
|
||||
row("short", "Short", listOf("Horror", "Comedy")).put("RunTimeTicks", 12_000_000_000L))
|
||||
assertEquals(listOf("fits"), findSuggestions(reply(*rows), user, { "t" }, listOf(strict), emptySet(), emptySet()).suggestions.map { it.id })
|
||||
}
|
||||
|
||||
@Test fun vortexOnlyTakesExactTitles() {
|
||||
assertTrue(SmartChannels.first { it.number == 103 }.exactTitles)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user