def index(): channels = CHANNELS[int(plugin.get_setting('channels'))] if channels == 'all': items = [{'label': 'M6Replay', 'path': plugin.url_for('show_channel', channel='M6')}, {'label': 'W9Replay', 'path': plugin.url_for('show_channel', channel='W9')}] return items else: return show_channel(channels)
def index(): channels = CHANNELS[int(plugin.get_setting('channels'))] if channels == 'all': items = [{ 'label': 'M6Replay', 'path': plugin.url_for('show_channel', channel='M6') }, { 'label': 'W9Replay', 'path': plugin.url_for('show_channel', channel='W9') }] return items else: return show_channel(channels)
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])
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])
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])
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])
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])
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])