diff --git a/VERSION b/VERSION index 7e099ec..a77d7d9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.6 \ No newline at end of file +1.2.7 \ No newline at end of file diff --git a/tmdbapis/objs/pagination.py b/tmdbapis/objs/pagination.py index c80c19f..dbd20ae 100644 --- a/tmdbapis/objs/pagination.py +++ b/tmdbapis/objs/pagination.py @@ -105,10 +105,12 @@ def get_results(self, amount: Optional[int] = None): Raises: :class:`~tmdbapis.exceptions.Invalid`: When ``amount`` is not greater than zero. """ + if self.total_results == 0: + return [] 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") + raise Invalid("amount must be greater than 0") results = [] current_page = 0 while len(results) < amount and current_page < self.total_pages: diff --git a/tmdbapis/tmdb.py b/tmdbapis/tmdb.py index 3c4041e..72aff40 100644 --- a/tmdbapis/tmdb.py +++ b/tmdbapis/tmdb.py @@ -375,11 +375,11 @@ def _validate_discover(self, is_movie, **kwargs): elif k in ["primary_release_year", "first_air_date_year", "vote_count.gte", "vote_count.lte", "with_runtime.gte", "with_runtime.lte"]: if not isinstance(v, int) or v <= 0: - raise Invalid(f"{k} must be an integer greater then 0") + raise Invalid(f"{k} must be an integer greater than 0") validated[k] = v elif k in ["vote_average.gte", "vote_average.lte"]: if not isinstance(v, (int, float)) or v <= 0: - raise Invalid(f"{k} must be a number greater then 0.0") + raise Invalid(f"{k} must be a number greater than 0.0") validated[k] = float(v) elif k == "with_watch_monetization_types": if v not in ["flatrate", "free", "ads", "rent", "buy"]: