From 5a3fdf1c4d53dbc196054914e2a69166ecd003cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 11 Jan 2022 22:59:59 +0200 Subject: [PATCH 1/3] Add deprecated~=1.2.13 dependency --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fa971311..b3cf4647 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ -requests>=2.25 +deprecated~=1.2.13 requests-oauthlib>=1.3 +requests>=2.25 From ae7d500729f96a72971cd2e8fc6cf2c5e8506deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 15 Jan 2022 14:35:42 +0200 Subject: [PATCH 2/3] Update documentation for get_watchlist --- trakt/sync.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/trakt/sync.py b/trakt/sync.py index c4bf7cfe..ed264d3d 100644 --- a/trakt/sync.py +++ b/trakt/sync.py @@ -302,13 +302,18 @@ def search_by_id(query, id_type='imdb', media_type=None, slugify_query=False): @get def get_watchlist(list_type=None, sort=None): """ - Get a watchlist. - + Returns all items in a user's watchlist filtered by type. optionally with a filter for a specific item type. + + The watchlist should not be used as a list + of what the user is actively watching. + :param list_type: Optional Filter by a specific type. Possible values: movies, shows, seasons or episodes. :param sort: Optional sort. Only if the type is also sent. Possible values: rank, added, released or title. + + https://trakt.docs.apiary.io/#reference/sync/get-watchlist/get-watchlist """ valid_type = ('movies', 'shows', 'seasons', 'episodes') valid_sort = ('rank', 'added', 'released', 'title') From 69936fbd4bb4ef3b86e71ff735c6e9fa81a23d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 15 Jan 2022 14:42:12 +0200 Subject: [PATCH 3/3] Deprecate get_watched to indicate wrong api call being used --- trakt/sync.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trakt/sync.py b/trakt/sync.py index ed264d3d..0ee8b594 100644 --- a/trakt/sync.py +++ b/trakt/sync.py @@ -2,6 +2,8 @@ """This module contains Trakt.tv sync endpoint support functions""" from datetime import datetime, timezone +from deprecated import deprecated + from trakt.core import get, post, delete from trakt.utils import slugify, extract_ids, timestamp @@ -349,6 +351,8 @@ def get_watchlist(list_type=None, sort=None): yield results +@deprecated("This method returns watchlist, not watched list. " + "This will be fixed in PyTrakt 4.x to return watched list") @get def get_watched(list_type=None, extended=None): """Return all movies or shows a user has watched sorted by most plays.