Skip to content

Commit

Permalink
Bugfix - Fetch all pages unless limit is set (#437)
Browse files Browse the repository at this point in the history
* adjusted conditional to fetch all pages unless a limit is set

* Only stop fetching once limit is reached
  • Loading branch information
aamorin authored Jun 18, 2024
1 parent a99eaa9 commit de05620
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/program/content/trakt.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def _fetch_data(url, headers, params):
if not data:
break
all_data.extend(data)
if not params.get("limit") or len(data) <= params["limit"]:
if params.get("limit") and len(all_data) >= params["limit"]:
break
page += 1
elif response.status_code == 429:
Expand Down

0 comments on commit de05620

Please sign in to comment.