From c825daef5894004e94f468f42e380c1d45c22998 Mon Sep 17 00:00:00 2001 From: Cyrille Bollu Date: Thu, 26 Jul 2018 13:17:47 +0200 Subject: [PATCH] Added thumbnail info to ListItem's --- peertube.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/peertube.py b/peertube.py index 3f0328b..f5a6d21 100755 --- a/peertube.py +++ b/peertube.py @@ -33,6 +33,7 @@ def list_videos(): inst = 'https://peertube.cpy.re' # Get the list of videos published by the instance + # TODO: Handle failures resp = urllib2.urlopen(inst + '/api/v1/videos') videos = json.load(resp) @@ -45,9 +46,10 @@ def list_videos(): for video in videos: # Create a list item with a text label - # TODO: Get video thumbnail and add it to list_item list_item = xbmcgui.ListItem(label=video['name']) - # list_item = xbmcgui.ListItem(label=metadata['name'], thumbnailImage=video['thumb']) + + # Add thumbnail + list_item.setArt({'thumb': inst + '/' + video['thumbnailPath']) # Set a fanart image for the list item. #list_item.setProperty('fanart_image', video['thumb'])