Skip to content

Commit

Permalink
get_results parameter is now Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed Apr 25, 2023
1 parent a07851f commit 4d85f0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tmdbapis/objs/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ def __len__(self):
def _get_page(self, page):
pass

def get_results(self, amount: int):
def get_results(self, amount: Optional[int] = None):
""" Gets the amount of results asked for from multiple pages. This method can make alot of calls to the API if you're not careful.
Parameters:
amount (int): Amount of Items you want returned.
amount (Optional[int]): Amount of Items you want returned.
Raises:
:class:`~tmdbapis.exceptions.Invalid`: When ``amount`` is not greater than zero.
"""
if int(amount) > self.total_results:
if amount is None or int(amount) > self.total_results:
amount = self.total_results
if amount < 1:
raise Invalid("amount must be greater then 0")
Expand Down

0 comments on commit 4d85f0a

Please sign in to comment.