mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-14 22:11:27 +00:00
Test Jellyfin item query compatibility path
This commit is contained in:
@@ -17,6 +17,35 @@ from scene_search.jellyfin import (
|
||||
|
||||
|
||||
class JellyfinIntegrationTests(unittest.TestCase):
|
||||
def test_item_detail_uses_items_query_not_direct_item_route(self) -> None:
|
||||
client = JellyfinClient("http://jellyfin.test", "token")
|
||||
response = Mock()
|
||||
response.ok = True
|
||||
response.json.return_value = {
|
||||
"Items": [
|
||||
{
|
||||
"Id": "item-1",
|
||||
"Name": "Example",
|
||||
"Tags": ["Tag"],
|
||||
"MediaSources": [],
|
||||
"Trickplay": {},
|
||||
"Etag": "etag-1",
|
||||
}
|
||||
]
|
||||
}
|
||||
client._get = Mock(return_value=response)
|
||||
|
||||
result = client.item("item-1")
|
||||
|
||||
self.assertEqual(result["Id"], "item-1")
|
||||
call = client._get.call_args
|
||||
self.assertEqual(call.args[0], "/Items")
|
||||
self.assertEqual(call.kwargs["params"]["Ids"], "item-1")
|
||||
self.assertIn("Tags", call.kwargs["params"]["Fields"])
|
||||
self.assertIn("MediaSources", call.kwargs["params"]["Fields"])
|
||||
self.assertIn("Trickplay", call.kwargs["params"]["Fields"])
|
||||
self.assertIn("Etag", call.kwargs["params"]["Fields"])
|
||||
|
||||
def test_select_trickplay_prefers_nearest_width(self) -> None:
|
||||
item = {
|
||||
"Trickplay": {
|
||||
|
||||
Reference in New Issue
Block a user