From 27db3a6eaaa8e82db6312c590ba3a5290350fc4a Mon Sep 17 00:00:00 2001 From: Blacktwin Date: Sun, 18 Nov 2018 16:17:31 -0500 Subject: [PATCH] metadata api fix --- utility/delete_watched_TV.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utility/delete_watched_TV.py b/utility/delete_watched_TV.py index b669de1..21c42f1 100644 --- a/utility/delete_watched_TV.py +++ b/utility/delete_watched_TV.py @@ -21,7 +21,9 @@ class METAINFO(object): def __init__(self, data=None): d = data or {} self.title = d['title'] - self.file = d['file'] + media_info = d['media_info'][0] + parts = media_info['parts'][0] + self.file = parts['file'] self.media_type = d['media_type'] self.grandparent_title = d['grandparent_title'] @@ -37,7 +39,7 @@ def get_metadata(rating_key): r = requests.get(TAUTULLI_URL.rstrip('/') + '/api/v2', params=payload) response = r.json() - res_data = response['response']['data']['metadata'] + res_data = response['response']['data'] return METAINFO(data=res_data) except Exception as e: