Пример #1
0
def show_clips(channel, program):
    clips = catalog.get_clips(channel, program)
    items = [{
        'label':
        clp['label'],
        'is_playable':
        True,
        'thumbnail':
        clp['thumb'],
        'info': {
            'date': clp['date'],
            'duration': clp['duration'],
            'plot': clp['desc']
        },
        'path':
        plugin.url_for('play_clip', channel=channel, clip=clp['id'])
    } for clp in clips]
    if program == 'all':
        return plugin.finish(items,
                             sort_methods=[
                                 SortMethod.LABEL, SortMethod.DATE,
                                 SortMethod.VIDEO_RUNTIME
                             ])
    else:
        return plugin.finish(items, sort_methods=[SortMethod.DATE])
Пример #2
0
def show_clips(channel, program):
    clips = catalog.get_clips(channel, program)
    items = [{'label': clp['label'],
              'is_playable': True,
              'thumbnail': clp['thumb'],
              'info': {'date': clp['date'],
                       'duration': clp['duration'],
                       'plot': clp['desc']},
              'path': plugin.url_for('play_clip', channel=channel, clip=clp['id'])
             } for clp in clips]
    if program == 'all':
        return plugin.finish(items, sort_methods=[SortMethod.LABEL, SortMethod.DATE, SortMethod.VIDEO_RUNTIME])
    else:
        return plugin.finish(items, sort_methods=[SortMethod.DATE])
Пример #3
0
def show_programs(channel, genre):
    programs = catalog.get_programs(channel, genre)
    items = [{'label': pgm['label'],
              'thumbnail': pgm['thumb'],
              'path': plugin.url_for('show_clips', channel=channel, program=pgm['id'])
             } for pgm in programs]
    return plugin.finish(items, sort_methods=[SortMethod.LABEL])
Пример #4
0
def show_genres(channel):
    genres = catalog.get_genres(channel)
    items = [{
        'label':
        gnr['label'],
        'path':
        plugin.url_for('show_programs', channel=channel, genre=gnr['id'])
    } for gnr in genres]
    return plugin.finish(items, sort_methods=[SortMethod.LABEL])
Пример #5
0
def show_programs(channel, genre):
    programs = catalog.get_programs(channel, genre)
    items = [{
        'label':
        pgm['label'],
        'thumbnail':
        pgm['thumb'],
        'path':
        plugin.url_for('show_clips', channel=channel, program=pgm['id'])
    } for pgm in programs]
    return plugin.finish(items, sort_methods=[SortMethod.LABEL])
Пример #6
0
def show_genres(channel):
    genres = catalog.get_genres(channel)
    items = [{'label': gnr['label'],
              'path': plugin.url_for('show_programs', channel=channel, genre=gnr['id'])
             } for gnr in genres]
    return plugin.finish(items, sort_methods=[SortMethod.LABEL])