mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-19 00:03:36 +00:00
Fetch Jellyfin item detail through Items query
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user