From efeaac7dd0c2770ccabd46649833b72441efb3a9 Mon Sep 17 00:00:00 2001 From: CastagnaIT Date: Mon, 15 Apr 2024 16:16:57 +0200 Subject: [PATCH] [infolabels] workaround for missing arts Recently request paths data for images such as: boxarts, interestingMoment, artWorkByType, storyArt sometime website dont return the data hoping this in future will be fixed on website we request also itemSummary data to get the boxArt value as fallback --- resources/lib/kodi/infolabels.py | 6 ++++-- resources/lib/utils/api_paths.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/lib/kodi/infolabels.py b/resources/lib/kodi/infolabels.py index 8299b8f23..f6ec0c387 100644 --- a/resources/lib/kodi/infolabels.py +++ b/resources/lib/kodi/infolabels.py @@ -252,18 +252,20 @@ def parse_art(videoid, item): paths.ART_PARTIAL_PATHS[2] + ['url'], item) fanart = common.get_path_safe( paths.ART_PARTIAL_PATHS[3] + [0, 'url'], item) + fallback = common.get_path_safe(['itemSummary', 'value', 'boxArt', 'url'], item) return _assign_art(videoid, boxart_large=boxarts.get(paths.ART_SIZE_FHD), boxart_small=boxarts.get(paths.ART_SIZE_SD), poster=boxarts.get(paths.ART_SIZE_POSTER), interesting_moment=interesting_moment.get(paths.ART_SIZE_FHD), clearlogo=clearlogo, - fanart=fanart) + fanart=fanart, + fallback=fallback) def _assign_art(videoid, **kwargs): """Assign the art available from Netflix to appropriate Kodi art""" - art = {'poster': _best_art([kwargs['poster']]), + art = {'poster': _best_art([kwargs['poster'], kwargs['fallback']]), 'fanart': _best_art([kwargs['fanart'], kwargs['interesting_moment'], kwargs['boxart_large'], diff --git a/resources/lib/utils/api_paths.py b/resources/lib/utils/api_paths.py index 762c66261..77645712f 100644 --- a/resources/lib/utils/api_paths.py +++ b/resources/lib/utils/api_paths.py @@ -51,7 +51,7 @@ [['requestId', 'summary', 'title', 'synopsis', 'regularSynopsis', 'evidence', 'queue', 'inRemindMeList', 'episodeCount', 'info', 'maturity', 'runtime', 'seasonCount', 'availability', 'trackIds', 'releaseYear', 'userRating', 'numSeasonsLabel', 'bookmarkPosition', 'creditsOffset', - 'dpSupplementalMessage', 'watched', 'delivery', 'sequiturEvidence', 'promoVideo', 'availability']], + 'dpSupplementalMessage', 'watched', 'delivery', 'sequiturEvidence', 'promoVideo', 'availability', 'itemSummary']], [['genres', 'tags', 'creators', 'directors', 'cast'], {'from': 0, 'to': 10}, ['id', 'name']] ] + ART_PARTIAL_PATHS