From 394717edadd5e6fab5ca471193b7e950e24bfc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 6 Apr 2024 16:34:29 +0300 Subject: [PATCH] fixup! fixup! Implement get_playback method --- trakt/sync.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/trakt/sync.py b/trakt/sync.py index 443c9a44..cfc1fc5e 100644 --- a/trakt/sync.py +++ b/trakt/sync.py @@ -368,8 +368,16 @@ def get_playback(list_type=None, start_at=None, end_at=None): if list_type: uri += f"/{list_type}" - data = yield uri - results = data + items = yield uri + results = [] + for item in items: + if "type" not in item: + continue + data = item.pop(item["type"]) + if "show" in item: + data["show"] = item.pop("show") + results.append(PlaybackEntry(**item, data=data)) + yield results