|
@@ -41,13 +41,15 @@ class AudiobookshelfClient:
|
|
|
return response.json().get("sessions", [])
|
|
return response.json().get("sessions", [])
|
|
|
|
|
|
|
|
async def get_user_progress(self) -> List[Dict[str, Any]]:
|
|
async def get_user_progress(self) -> List[Dict[str, Any]]:
|
|
|
- """Get user's media progress for all items."""
|
|
|
|
|
|
|
+ """Get user's items in progress."""
|
|
|
async with httpx.AsyncClient() as client:
|
|
async with httpx.AsyncClient() as client:
|
|
|
response = await client.get(
|
|
response = await client.get(
|
|
|
- f"{self.base_url}/api/me/progress", headers=self.headers
|
|
|
|
|
|
|
+ f"{self.base_url}/api/me/items-in-progress", headers=self.headers
|
|
|
)
|
|
)
|
|
|
response.raise_for_status()
|
|
response.raise_for_status()
|
|
|
- return response.json().get("libraryItems", [])
|
|
|
|
|
|
|
+ # The response is an array of library items with progress
|
|
|
|
|
+ result = response.json()
|
|
|
|
|
+ return result.get("libraryItems", result if isinstance(result, list) else [])
|
|
|
|
|
|
|
|
async def get_item_details(self, item_id: str) -> Dict[str, Any]:
|
|
async def get_item_details(self, item_id: str) -> Dict[str, Any]:
|
|
|
"""Get detailed information about a specific library item."""
|
|
"""Get detailed information about a specific library item."""
|