def map_category_item(item, category_code): code = item.get('code') title = item.get('title') if code: path = plugin.url_for('sub_category_by_code', sub_category_code=code) else: path = plugin.url_for('sub_category_by_title', category_code=category_code, sub_category_title=utils.sanitize_string(title)) return {'label': title, 'path': path}
def map_video(config): programId = config.get('programId') kind = config.get('kind') duration = int(config.get('duration') or 0) * \ 60 or config.get('durationSeconds') airdate = config.get('broadcastBegin') if airdate is not None: airdate = str(utils.parse_date(airdate)) return { 'label': utils.format_title_and_subtitle(config.get('title'), config.get('subtitle')), 'path': plugin.url_for('play', kind=kind, program_id=programId), 'thumbnail': config.get('imageUrl'), 'is_playable': True, 'info_type': 'video', 'info': { 'title': config.get('title'), 'duration': duration, 'genre': config.get('genrePresse'), 'plot': config.get('shortDescription') or config.get('fullDescription'), 'plotoutline': config.get('teaserText'), # year is not correctly used by kodi :( # the aired year will be used by kodi for production year :( # 'year': int(config.get('productionYear')), 'country': [country.get('label') for country in config.get('productionCountries', [])], 'director': config.get('director'), 'aired': airdate }, 'properties': { 'fanart_image': config.get('imageUrl'), } }
def map_video(config): programId = config.get('programId') kind = config.get('kind') duration = int(config.get('duration') or 0) * \ 60 or config.get('durationSeconds') airdate = config.get('broadcastBegin') if airdate is not None: airdate = str(utils.parse_date(airdate)) return { 'label': utils.format_title_and_subtitle(config.get('title'), config.get('subtitle')), 'path': plugin.url_for('play', kind=kind, program_id=programId), 'thumbnail': config.get('imageUrl'), 'is_playable': True, 'info_type': 'video', 'info': { 'title': config.get('title'), 'duration': duration, 'genre': config.get('genrePresse'), 'plot': config.get('shortDescription') or config.get('fullDescription'), 'plotoutline': config.get('teaserText'), # year is not correctly used by kodi :( # the aired year will be used by kodi for production year :( #'year': int(config.get('productionYear')), 'country': [country.get('label') for country in config.get('productionCountries', [])], 'director': config.get('director'), 'aired': airdate }, 'properties': { 'fanart_image': config.get('imageUrl'), } }
def map_playlist(config): programId = config.get('programId') kind = config.get('kind') return { 'label': utils.format_title_and_subtitle(config.get('title'), config.get('subtitle')), 'path': plugin.url_for('collection', kind=kind, collection_id=programId), 'thumbnail': config.get('imageUrl'), 'info': { 'title': config.get('title'), 'plotoutline': config.get('teaserText') } }
def map_category_item(item, category_code): # code = item.get('code') title = item.get('title') # if code: # path = plugin.url_for('sub_category_by_code', # category_code=category_code, sub_category_code=code) # else: path = plugin.url_for('sub_category_by_title', category_code=category_code, sub_category_title=utils.sanitize_string(title)) return { 'label': title, 'path': path }
def map_video(config): programId = config.get('programId') kind = config.get('kind') duration = int(config.get('duration') or 0) * \ 60 or config.get('durationSeconds') airdate = config.get('broadcastBegin') if airdate is not None: airdate = str(utils.parse_date(airdate)) # Some content is not playable # json msg : You don't have the sufficient rights to access this kind path = plugin.url_for('play', kind=kind, program_id=programId) if path is not None: is_playable = True else: xbmc.log('Content for ' + str(kind) + ':' + str(programId) + ' filtered due insufficient rights', 2) is_playable = False return { 'label': utils.format_title_and_subtitle(config.get('title'), config.get('subtitle')), 'path': path, 'thumbnail': config.get('imageUrl'), 'is_playable': is_playable, 'info_type': 'video', 'info': { 'title': config.get('title'), 'duration': duration, 'genre': config.get('genrePresse'), 'plot': config.get('shortDescription'), 'plotoutline': config.get('teaserText'), # year is not correctly used by kodi :( # the aired year will be used by kodi for production year :( #'year': int(config.get('productionYear')), 'country': [country.get('label') for country in config.get('productionCountries', [])], 'director': config.get('director'), 'aired': airdate }, 'properties': { 'fanart_image': config.get('imageUrl'), } }
def create_magazines_item(): return { 'label': 'Emissions I18N', 'path': plugin.url_for('magazines') }
def create_creative_item(): return { 'label': 'Creative I18N', 'path': plugin.url_for('creative') }
def create_most_viewed_item(): return { 'label': plugin.addon.getLocalizedString(30006), 'path': plugin.url_for('most_viewed') }
def map_categories_item(item): return { 'label': utils.colorize(item.get('title'), item.get('color')), 'path': plugin.url_for('category', category_code=item.get('code')) }
def create_newest_item(): return { 'label': 'Most recent', 'path': plugin.url_for('newest') }
def create_weekly_item(): return { 'label':'Weekly Program', 'path': plugin.url_for('weekly') }
def create_week_item(): return { 'label': 'Semaine I18N', 'path': plugin.url_for('weekly') }
def create_last_chance_item(): return { 'label': plugin.addon.getLocalizedString(30007), 'path': plugin.url_for('last_chance') }
def create_newest_item(): return { 'label': plugin.addon.getLocalizedString(30005), 'path': plugin.url_for('newest') }
def create_last_chance_item(): return { 'label': 'Last Chance', 'path': plugin.url_for('last_chance') }
def create_most_viewed_item(): return { 'label': 'Most viewed', 'path': plugin.url_for('most_viewed') }