Clarify Sonarr search download behavior

This commit is contained in:
Mikei386
2026-08-23 14:50:08 +02:00
parent 09634a27f9
commit fea4a83582
3 changed files with 65 additions and 4 deletions
+29
View File
@@ -74,6 +74,35 @@ class ReleaseGrabTests(unittest.IsolatedAsyncioTestCase):
{"series_id": 42, "season_number": 7, "guid": "different-guid"},
)
async def test_search_can_limit_results_to_group_and_season_pack(self) -> None:
client = FakeSonarrClient()
client.get_release = lambda **_kwargs: [
dict(client.release),
{
**client.release,
"guid": "episode-guid",
"title": "Mord.ist.ihr.Hobby.S07E02.German.1080p-FuN",
"fullSeason": False,
},
{
**client.release,
"guid": "other-group",
"title": "Mord.ist.ihr.Hobby.S07.German.1080p-HQC",
"releaseGroup": "HQC",
},
]
result = await mcp_sonarr._search_releases(
client,
{
"series_id": 42,
"season_number": 7,
"release_group": "FuN",
"season_pack_only": True,
},
)
self.assertEqual(result["results"]["total"], 1)
self.assertEqual(result["results"]["items"][0]["guid"], "exact-guid")
if __name__ == "__main__":
unittest.main()