From 333251dcda645c48d3013cf67a937bb10631a564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 9 Jul 2026 16:43:46 +0300 Subject: [PATCH 1/4] Rename _build_watched_movies to _build_movies for re-use --- trakt/users.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trakt/users.py b/trakt/users.py index e72407c..307f301 100644 --- a/trakt/users.py +++ b/trakt/users.py @@ -512,7 +512,7 @@ def show_collection(self): self._show_collection.append(show) yield self._show_collection - def _build_watched_movies(self, data): + def _build_movies(self, data): """Parse raw API response data into a list of :class:`Movie` objects. :param data: List of raw movie dicts from the Trakt API @@ -541,7 +541,7 @@ def get_watched_movies(self, page=None, limit=None): ) data = yield uri - yield self._build_watched_movies(data) + yield self._build_movies(data) @property def watched_movies(self): @@ -553,7 +553,7 @@ def watched_movies(self): 'users/{user}/watched/movies', user=slugify(self.username), ) - self._watched_movies = self._build_watched_movies(all_movies or []) + self._watched_movies = self._build_movies(all_movies or []) return self._watched_movies @property From 89de789c9a90ef986d18f16613e0023b72d660e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 9 Jul 2026 16:45:01 +0300 Subject: [PATCH 2/4] Mark _build_movies static --- trakt/users.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trakt/users.py b/trakt/users.py index 307f301..4e208cd 100644 --- a/trakt/users.py +++ b/trakt/users.py @@ -512,7 +512,8 @@ def show_collection(self): self._show_collection.append(show) yield self._show_collection - def _build_movies(self, data): + @staticmethod + def _build_movies(data): """Parse raw API response data into a list of :class:`Movie` objects. :param data: List of raw movie dicts from the Trakt API From 06d548cf8894189281a2e058e51fe59b02fe9021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 9 Jul 2026 16:47:21 +0300 Subject: [PATCH 3/4] Add pagination to watchlist_movies --- trakt/users.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/trakt/users.py b/trakt/users.py index 4e208cd..37ea160 100644 --- a/trakt/users.py +++ b/trakt/users.py @@ -452,12 +452,11 @@ def watchlist_shows(self): yield self._show_watchlist @property - @get def watchlist_movies(self): """Returns all watchlist movies of :class:`User`. """ if self._movie_watchlist is None: - data = yield 'users/{username}/watchlist/movies'.format( + data = paginate('users/{username}/watchlist/movies', username=slugify(self.username), ) self._movie_watchlist = [] @@ -465,8 +464,7 @@ def watchlist_movies(self): mov = movie.pop('movie') mov.update(movie) self._movie_watchlist.append(Movie(**mov)) - yield self._movie_watchlist - yield self._movie_watchlist + return self._movie_watchlist @property @get From f4ea689791073371f2cfa3c077e735ec5da948e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 9 Jul 2026 16:48:20 +0300 Subject: [PATCH 4/4] Add pagination to watchlist_shows --- trakt/users.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/trakt/users.py b/trakt/users.py index 37ea160..65e7c70 100644 --- a/trakt/users.py +++ b/trakt/users.py @@ -435,12 +435,11 @@ def lists(self): yield self._lists @property - @get def watchlist_shows(self): """Returns all watchlist shows of :class:`User`. """ if self._show_watchlist is None: - data = yield 'users/{username}/watchlist/shows'.format( + data = paginate('users/{username}/watchlist/shows', username=slugify(self.username), ) self._show_watchlist = [] @@ -448,8 +447,7 @@ def watchlist_shows(self): show_data = show.pop('show') show_data.update(show) self._show_watchlist.append(TVShow(**show_data)) - yield self._show_watchlist - yield self._show_watchlist + return self._show_watchlist @property def watchlist_movies(self):