示例#1
0
def show_tvguide_detail(channel=None, date=None):
    """ Shows the programs of a specific date in the tv guide """
    try:
        _vtmGoEpg = VtmGoEpg(kodi)
        epg = _vtmGoEpg.get_epg(channel=channel, date=date)
    except Exception as ex:
        kodi.show_notification(message=str(ex))
        raise

    listing = []
    for broadcast in epg.broadcasts:
        title = '{time} - {title}{live}'.format(
            time=broadcast.time.strftime('%H:%M'),
            title=broadcast.title,
            live=' [I](LIVE)[/I]' if broadcast.live else '')

        if broadcast.airing:
            title = '[B]{title}[/B]'.format(title=title)

        listing.append(
            TitleItem(title=title,
                      path=routing.url_for(
                          play_epg,
                          channel=channel,
                          program_type=broadcast.playable_type,
                          epg_id=broadcast.uuid),
                      art_dict={
                          'icon': broadcast.image,
                          'thumb': broadcast.image,
                      },
                      info_dict={
                          'title': title,
                          'plot': broadcast.description,
                          'duration': broadcast.duration,
                          'mediatype': 'video',
                      },
                      stream_dict={
                          'duration': broadcast.duration,
                          'codec': 'h264',
                          'height': 1080,
                          'width': 1920,
                      },
                      is_playable=True))

    kodi.show_listing(listing, 30013, content='tvshows')