Skip to content

Commit

Permalink
[infolabels] workaround for missing arts
Browse files Browse the repository at this point in the history
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
  • Loading branch information
CastagnaIT committed Apr 15, 2024
1 parent 7944699 commit efeaac7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions resources/lib/kodi/infolabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/utils/api_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efeaac7

Please sign in to comment.