def convertStreamToListItem(self, stream): channel = stream[Keys.CHANNEL] videobanner = channel.get(Keys.PROFILE_BANNER) if not videobanner: videobanner = channel.get(Keys.VIDEO_BANNER) if channel.get( Keys.VIDEO_BANNER) else Images.FANART preview = stream.get(Keys.PREVIEW) if preview: preview = preview.get(Keys.MEDIUM) logo = channel.get(Keys.LOGO) if channel.get( Keys.LOGO) else Images.VIDEOTHUMB image = preview if preview else logo title = self.getTitleForStream(stream) info = self.getPlotForStream(stream) info['mediatype'] = getMediaType() return { 'label': title, 'path': self.plugin.url_for(endpoint='playLive', name=channel[Keys.NAME], quality='-2'), 'context_menu': [(self.plugin.get_string(30077), 'RunPlugin(%s)' % self.plugin.url_for( endpoint='playLive', name=channel[Keys.NAME], quality='-1')) ], 'is_playable': True, 'icon': image, 'thumbnail': image, 'info': info, 'art': theArt({ 'fanart': videobanner, 'poster': image, 'thumb': image }), 'stream_info': { 'video': { 'height': stream.get(Keys.VIDEO_HEIGHT), 'duration': 0 } } }
def convertVideoListToListItem(self, video): duration = video.get(Keys.LENGTH) plot = video.get(Keys.DESCRIPTION) date = video.get(Keys.CREATED_AT)[:10] if video.get( Keys.CREATED_AT) else '' year = video.get(Keys.CREATED_AT)[:4] if video.get( Keys.CREATED_AT) else '' image = video.get(Keys.PREVIEW) if video.get( Keys.PREVIEW) else Images.VIDEOTHUMB return { 'label': video[Keys.TITLE], 'path': self.plugin.url_for(endpoint='playVideo', _id=video['_id'], quality='-2'), 'context_menu': [(self.plugin.get_string(30077), 'RunPlugin(%s)' % self.plugin.url_for( endpoint='playVideo', _id=video['_id'], quality='-1'))], 'is_playable': True, 'icon': image, 'thumbnail': image, 'info': { 'duration': str(duration), 'plot': plot, 'plotoutline': plot, 'tagline': plot, 'year': year, 'date': date, 'premiered': date, 'mediatype': getMediaType() }, 'art': theArt({ 'poster': image, 'thumb': image }), 'stream_info': { 'video': { 'duration': duration } } }
def convertVideoListToListItem(self, video): duration = video.get(Keys.LENGTH) plot = video.get(Keys.DESCRIPTION) date = video.get(Keys.CREATED_AT)[:10] if video.get(Keys.CREATED_AT) else '' year = video.get(Keys.CREATED_AT)[:4] if video.get(Keys.CREATED_AT) else '' image = video.get(Keys.PREVIEW) if video.get(Keys.PREVIEW) else Images.VIDEOTHUMB return {'label': video[Keys.TITLE], 'path': self.plugin.url_for(endpoint='playVideo', _id=video['_id'], quality='-2'), 'context_menu': [(self.plugin.get_string(30077), 'RunPlugin(%s)' % self.plugin.url_for(endpoint='playVideo', _id=video['_id'], quality='-1'))], 'is_playable': True, 'icon': image, 'thumbnail': image, 'info': {'duration': str(duration), 'plot': plot, 'plotoutline': plot, 'tagline': plot, 'year': year, 'date': date, 'premiered': date, 'mediatype': getMediaType()}, 'art': theArt({'poster': image, 'thumb': image}), 'stream_info': {'video': {'duration': duration}}}
def convertStreamToListItem(self, stream): channel = stream[Keys.CHANNEL] videobanner = channel.get(Keys.PROFILE_BANNER) if not videobanner: videobanner = channel.get(Keys.VIDEO_BANNER) if channel.get(Keys.VIDEO_BANNER) else Images.FANART preview = stream.get(Keys.PREVIEW) if preview: preview = preview.get(Keys.MEDIUM) logo = channel.get(Keys.LOGO) if channel.get(Keys.LOGO) else Images.VIDEOTHUMB image = preview if preview else logo title = self.getTitleForStream(stream) info = self.getPlotForStream(stream) info['mediatype'] = getMediaType() return {'label': title, 'path': self.plugin.url_for(endpoint='playLive', name=channel[Keys.NAME], quality='-2'), 'context_menu': [(self.plugin.get_string(30077), 'RunPlugin(%s)' % self.plugin.url_for(endpoint='playLive', name=channel[Keys.NAME], quality='-1'))], 'is_playable': True, 'icon': image, 'thumbnail': image, 'info': info, 'art': theArt({'fanart': videobanner, 'poster': image, 'thumb': image}), 'stream_info': {'video': {'height': stream.get(Keys.VIDEO_HEIGHT), 'duration': 0}}}