Skip to content

Commit

Permalink
add get parameters for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
fmunkes committed Jan 20, 2025
1 parent e7a1abd commit b5dad38
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions music_assistant/providers/audiobookshelf/abs_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,18 @@ async def get_all_podcasts(self) -> AsyncGenerator[ABSLibraryItemExpandedPodcast
yield podcast

async def _get_lib_items(self, lib: ABSLibrary) -> AsyncGenerator[bytes]:
"""Get library items with pagination."""
"""Get library items with pagination.
Note:
- minified=1 -> minified items. However, there appears to be
a bug in abs, so we always get minified items. Still there for
consistency
- collapseseries=0 -> even if books are part of a series, they will be single items
"""
page_cnt = 0
while True:
data = await self._get(
f"/libraries/{lib.id_}/items",
f"/libraries/{lib.id_}/items?minified=1&collapseseries=0",
params={"limit": LIMIT_ITEMS_PER_PAGE, "page": page_cnt},
)
page_cnt += 1
Expand Down

0 comments on commit b5dad38

Please sign in to comment.