コード例 #1
0
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}
コード例 #2
0
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'),
        }
    }
コード例 #3
0
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'),
        }
    }
コード例 #4
0
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')
        }
    }
コード例 #5
0
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')
        }
    }
コード例 #6
0
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
    }
コード例 #7
0
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'),
        }
    }
コード例 #8
0
def create_magazines_item():
    return {
        'label': 'Emissions I18N',
        'path': plugin.url_for('magazines')
    }
コード例 #9
0
def create_creative_item():
    return {
        'label': 'Creative I18N',
        'path': plugin.url_for('creative')
    }
コード例 #10
0
def create_magazines_item():
    return {
        'label': 'Emissions I18N',
        'path': plugin.url_for('magazines')
    }
コード例 #11
0
def create_most_viewed_item():
    return {
        'label': plugin.addon.getLocalizedString(30006),
        'path': plugin.url_for('most_viewed')
    }
コード例 #12
0
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'))
    }
コード例 #13
0
def create_most_viewed_item():
    return {
        'label': plugin.addon.getLocalizedString(30006),
        'path': plugin.url_for('most_viewed')
    }
コード例 #14
0
def create_newest_item():
    return {
        'label': 'Most recent',
        'path': plugin.url_for('newest')
    }
コード例 #15
0
def create_weekly_item():
    return {
	'label':'Weekly Program',
	'path': plugin.url_for('weekly')
    }
コード例 #16
0
def create_week_item():
    return {
        'label': 'Semaine I18N',
        'path': plugin.url_for('weekly')
    }
コード例 #17
0
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'))
    }
コード例 #18
0
def create_last_chance_item():
    return {
        'label': plugin.addon.getLocalizedString(30007),
        'path': plugin.url_for('last_chance')
    }
コード例 #19
0
def create_week_item():
    return {
        'label': 'Semaine I18N',
        'path': plugin.url_for('weekly')
    }
コード例 #20
0
def create_newest_item():
    return {
        'label': plugin.addon.getLocalizedString(30005),
        'path': plugin.url_for('newest')
    }
コード例 #21
0
def create_creative_item():
    return {
        'label': 'Creative I18N',
        'path': plugin.url_for('creative')
    }
コード例 #22
0
def create_last_chance_item():
    return {
        'label': plugin.addon.getLocalizedString(30007),
        'path': plugin.url_for('last_chance')
    }
コード例 #23
0
def create_last_chance_item():
    return {
        'label': 'Last Chance',
        'path': plugin.url_for('last_chance')
    }
コード例 #24
0
def create_most_viewed_item():
    return {
        'label': 'Most viewed',
        'path': plugin.url_for('most_viewed')
    }
コード例 #25
0
def create_newest_item():
    return {
        'label': plugin.addon.getLocalizedString(30005),
        'path': plugin.url_for('newest')
    }