From 3f0f9a324ac10bc8d82cef299b9a6e1c19e55156 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 26 May 2018 09:50:47 +0100 Subject: [PATCH] fix popular lists. issue was they are not returned in their own subdict, e.g. {'movie': { ITEM }} --- media/trakt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/trakt.py b/media/trakt.py index 90dbc00..ca73011 100644 --- a/media/trakt.py +++ b/media/trakt.py @@ -84,7 +84,10 @@ class Trakt: for item in resp_json: if item not in processed: - processed.append(item) + if object_name.rstrip('s') not in item and 'title' in item: + processed.append({object_name.rstrip('s'): item}) + else: + processed.append(item) # check if we have fetched the last page, break if so if total_pages == 0: