@@ -65,6 +65,7 @@ def get_categories():
6565 Here you can insert some parsing code that retrieves
6666 the list of video categories (e.g. 'Movies', 'TV-shows', 'Documentaries' etc.)
6767 from some site or server.
68+
6869 :return: list
6970 """
7071 return VIDEOS .keys ()
@@ -75,6 +76,7 @@ def get_videos(category):
7576 Get the list of videofiles/streams.
7677 Here you can insert some parsing code that retrieves
7778 the list of videostreams in a given category from some site or server.
79+
7880 :param category: str
7981 :return: list
8082 """
@@ -84,7 +86,6 @@ def get_videos(category):
8486def list_categories ():
8587 """
8688 Create the list of video categories in the Kodi interface.
87- :return: None
8889 """
8990 # Get video categories
9091 categories = get_categories ()
@@ -94,9 +95,12 @@ def list_categories():
9495 for category in categories :
9596 # Create a list item with a text label and a thumbnail image.
9697 list_item = xbmcgui .ListItem (label = category , thumbnailImage = VIDEOS [category ][0 ]['thumb' ])
97- # Set a fanart image for the list item.
98- # Here we use the same image as the thumbnail for simplicity's sake.
99- list_item .setProperty ('fanart_image' , VIDEOS [category ][0 ]['thumb' ])
98+ # Set graphics (thumbnail, fanart, banner, poster, landscape etc.) for the list item.
99+ # Here we use the same image for all items for simplicity's sake.
100+ # In a real-life plugin you need to set each image accordingly.
101+ list_item .setArt ({'thumb' : VIDEOS [category ][0 ]['thumb' ],
102+ 'icon' : VIDEOS [category ][0 ]['thumb' ],
103+ 'fanart' : VIDEOS [category ][0 ]['thumb' ]})
100104 # Set additional info for the list item.
101105 # Here we use a category name for both properties for for simplicity's sake.
102106 # setInfo allows to set various information for an item.
@@ -123,8 +127,8 @@ def list_categories():
123127def list_videos (category ):
124128 """
125129 Create the list of playable videos in the Kodi interface.
130+
126131 :param category: str
127- :return: None
128132 """
129133 # Get the list of videos in the category.
130134 videos = get_videos (category )
@@ -133,15 +137,13 @@ def list_videos(category):
133137 # Iterate through videos.
134138 for video in videos :
135139 # Create a list item with a text label and a thumbnail image.
136- list_item = xbmcgui .ListItem (label = video ['name' ], thumbnailImage = video ['thumb' ])
137- # Set a fanart image for the list item.
138- # Here we use the same image as the thumbnail for simplicity's sake.
139- list_item .setProperty ('fanart_image' , video ['thumb' ])
140+ list_item = xbmcgui .ListItem (label = video ['name' ])
140141 # Set additional info for the list item.
141142 list_item .setInfo ('video' , {'title' : video ['name' ], 'genre' : video ['genre' ]})
142- # Set additional graphics (banner, poster, landscape etc.) for the list item.
143- # Again, here we use the same image as the thumbnail for simplicity's sake.
144- list_item .setArt ({'landscape' : video ['thumb' ]})
143+ # Set graphics (thumbnail, fanart, banner, poster, landscape etc.) for the list item.
144+ # Here we use the same image for all items for simplicity's sake.
145+ # In a real-life plugin you need to set each image accordingly.
146+ list_item .setArt ({'thumb' : video ['thumb' ], 'icon' : video ['thumb' ], 'fanart' : video ['thumb' ]})
145147 # Set 'IsPlayable' property to 'true'.
146148 # This is mandatory for playable items!
147149 list_item .setProperty ('IsPlayable' , 'true' )
@@ -166,8 +168,8 @@ def list_videos(category):
166168def play_video (path ):
167169 """
168170 Play a video by the provided path.
171+
169172 :param path: str
170- :return: None
171173 """
172174 # Create a playable item with a path to play.
173175 play_item = xbmcgui .ListItem (path = path )
@@ -179,8 +181,8 @@ def router(paramstring):
179181 """
180182 Router function that calls other functions
181183 depending on the provided paramstring
184+
182185 :param paramstring:
183- :return:
184186 """
185187 # Parse a URL-encoded paramstring to the dictionary of
186188 # {<parameter>: <value>} elements
0 commit comments