Add fast Jellyfin library item counts

This commit is contained in:
Sleeps
2026-10-06 18:26:34 +01:00
parent b7009aafa4
commit 4576c4d7d0
+14
View File
@@ -122,6 +122,20 @@ class JellyfinClient:
return results[:limit] if limit is not None else results
def item_count(self, library_id: str) -> int:
data = self._get(
"/Items",
params={
"ParentId": library_id,
"Recursive": "true",
"IncludeItemTypes": "Movie,Episode,Video",
"EnableTotalRecordCount": "true",
"StartIndex": 0,
"Limit": 1,
},
).json()
return int(data.get("TotalRecordCount") or 0)
def item(self, item_id: str) -> dict[str, Any]:
data = self._get(
"/Items",