From ab199f80daac9093f0c92606743d2e8374ed7253 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 26 Sep 2024 13:37:26 -0400 Subject: [PATCH] fix get_results --- VERSION | 2 +- tmdbapis/objs/pagination.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index b830554..e54077f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.20 \ No newline at end of file +1.2.21 \ No newline at end of file diff --git a/tmdbapis/objs/pagination.py b/tmdbapis/objs/pagination.py index 7d1eb9b..6eadcb1 100644 --- a/tmdbapis/objs/pagination.py +++ b/tmdbapis/objs/pagination.py @@ -113,7 +113,7 @@ def get_results(self, amount: Optional[int] = None): raise Invalid("amount must be greater than 0") results = [] current_page = 0 - while len(results) < amount and current_page < self.total_pages: + while len(results) < amount and current_page < self.total_pages and current_page < 500: current_page += 1 self.load_page(current_page) if len(results) + len(self.results) < amount: