mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-14 22:11:27 +00:00
Add fast Jellyfin library item counts
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user