Fetch Jellyfin item detail through Items query

This commit is contained in:
Sleeps
2026-10-06 15:58:49 +01:00
parent a850df304d
commit e947dcac43
+18 -2
View File
@@ -12,6 +12,9 @@ import requests
from PIL import Image
ITEM_DETAIL_FIELDS = "Path,MediaSources,Tags,Trickplay,Etag"
@dataclass(frozen=True)
class TrickplaySelection:
media_source_id: str | None
@@ -101,7 +104,7 @@ class JellyfinClient:
"ParentId": library_id,
"Recursive": "true",
"IncludeItemTypes": "Movie,Episode,Video",
"Fields": "Path",
"Fields": ITEM_DETAIL_FIELDS,
"EnableTotalRecordCount": "true",
"StartIndex": start,
"Limit": request_limit,
@@ -120,7 +123,20 @@ class JellyfinClient:
return results[:limit] if limit is not None else results
def item(self, item_id: str) -> dict[str, Any]:
return self._get(f"/Items/{item_id}").json()
data = self._get(
"/Items",
params={
"Ids": item_id,
"Recursive": "true",
"Fields": ITEM_DETAIL_FIELDS,
"EnableTotalRecordCount": "false",
"Limit": 1,
},
).json()
items = list(data.get("Items") or [])
if not items:
raise RuntimeError(f"Jellyfin item not found: {item_id}")
return items[0]
@staticmethod
def select_trickplay(