From 7e3d768e56beed5878833540cbd7573c63f06fff Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Tue, 21 Jan 2025 20:59:35 -0800 Subject: [PATCH 1/4] support watchlist --- plugins/trakt.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/trakt.py b/plugins/trakt.py index f1aa962..c9b8bdb 100644 --- a/plugins/trakt.py +++ b/plugins/trakt.py @@ -135,7 +135,13 @@ def get_list(list_id, config=None): headers["Authorization"] = f"Bearer {access_token}" logger.debug("Access token loaded") - if list_id.startswith("shows/") or list_id.startswith("movies/"): + if list_id.startswith("users"): + r = requests.get(f"https://api.trakt.tv/{list_id}", headers=headers) + components = list_id.split("/") + list_name = f"{components[1]}'s {components[2]}" + description = f"{components[1]}'s {components[2]}" + items_data = r.json() + elif list_id.startswith("shows/") or list_id.startswith("movies/"): # Chart logger.debug("Trakt chart list") r = requests.get(f"https://api.trakt.tv/{list_id}", headers=headers) From 3f8bcba29158373c0def543af08c7920c7514afe Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Tue, 21 Jan 2025 21:07:04 -0800 Subject: [PATCH 2/4] added log line --- plugins/trakt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/trakt.py b/plugins/trakt.py index c9b8bdb..c7ba89c 100644 --- a/plugins/trakt.py +++ b/plugins/trakt.py @@ -136,6 +136,7 @@ def get_list(list_id, config=None): logger.debug("Access token loaded") if list_id.startswith("users"): + logger.debug("Trakt Private User list") r = requests.get(f"https://api.trakt.tv/{list_id}", headers=headers) components = list_id.split("/") list_name = f"{components[1]}'s {components[2]}" @@ -155,7 +156,7 @@ def get_list(list_id, config=None): items_data = r.json() else: - logger.debug("Trakt User list") + logger.debug("Trakt Public User list") r = requests.get(f"https://api.trakt.tv/lists/{list_id}", headers=headers) list_name = r.json()["name"] description = r.json()["description"] From d6b615f366c3ca73f0af03bb98da8b386556696a Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Tue, 21 Jan 2025 21:07:54 -0800 Subject: [PATCH 3/4] added / --- plugins/trakt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/trakt.py b/plugins/trakt.py index c7ba89c..55c6f3b 100644 --- a/plugins/trakt.py +++ b/plugins/trakt.py @@ -135,7 +135,7 @@ def get_list(list_id, config=None): headers["Authorization"] = f"Bearer {access_token}" logger.debug("Access token loaded") - if list_id.startswith("users"): + if list_id.startswith("users/"): logger.debug("Trakt Private User list") r = requests.get(f"https://api.trakt.tv/{list_id}", headers=headers) components = list_id.split("/") From 50761b3f494538a813e1042dd7b806ee80efe6a2 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Tue, 21 Jan 2025 21:13:20 -0800 Subject: [PATCH 4/4] changed log wording --- plugins/trakt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/trakt.py b/plugins/trakt.py index 55c6f3b..1056cb7 100644 --- a/plugins/trakt.py +++ b/plugins/trakt.py @@ -136,7 +136,7 @@ def get_list(list_id, config=None): logger.debug("Access token loaded") if list_id.startswith("users/"): - logger.debug("Trakt Private User list") + logger.debug("Trakt Default User list") r = requests.get(f"https://api.trakt.tv/{list_id}", headers=headers) components = list_id.split("/") list_name = f"{components[1]}'s {components[2]}" @@ -156,7 +156,7 @@ def get_list(list_id, config=None): items_data = r.json() else: - logger.debug("Trakt Public User list") + logger.debug("Trakt User list") r = requests.get(f"https://api.trakt.tv/lists/{list_id}", headers=headers) list_name = r.json()["name"] description = r.json()["description"]