Пример #1
0
def show_replay_epg(channelId, date):
    replay = Replay()
    
    channelName = ""
    for station in stations.tv_stations:
        if station["id"] == channelId:
            channelTag = station["tag"]
    
    programmes = replay.getProgrammes(channelId, channelTag, date)
    
    # sort timetable
    timetable = utils.sortedDictKeys(programmes)

    for entry in timetable:
        if programmes[entry]["h264"] == "":
            # program is not available
            title = entry + " " + programmes[entry]["t"]
            liStyle = xbmcgui.ListItem(title,
                thumbnailImage=programmes[entry]["image"])
            addLinkItem({"mode": "nop",
                "title": programmes[entry]["t"].encode('utf8'),
                "thumbnail": programmes[entry]["image"]}, liStyle)
        else:
            title = "[COLOR blue]" + entry + " " + programmes[entry]["t"] + "[/COLOR]"
            liStyle = xbmcgui.ListItem(title,
                thumbnailImage=programmes[entry]["image"])
            addLinkItem({"mode": "play",
                "title": programmes[entry]["t"].encode('utf8'),        
                "url": programmes[entry]["h264"],
                "thumbnail": programmes[entry]["image"]}, liStyle)
    xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
Пример #2
0
def show_replay_epg(channelId, date):
    replay = Replay()
    
    for station in tv_stations:
        if station["id"] == channelId:
            channelTag = station["tag"]
            break
    
    programmes = replay.getProgrammes(channelId, channelTag, date)
    
    # sort timetable
    timetable = utils.sortedDictKeys(programmes)

    for entry in timetable:
        recording = programmes[entry]
        
        title = recording["t"]
        plot = recording["d"]
        thumbnail = recording["image"]
        
        if recording["urlTablet"] != "":
            videoUrl = recording["urlTablet"]
        elif recording["h264"] != "":
            videoUrl = recording["h264"]
        else:
            videoUrl = None
        
        if videoUrl is None:
            # programme is not available
            liStyle = xbmcgui.ListItem(entry + " " + title,
                thumbnailImage=thumbnail)
            liStyle.setInfo(type="Video", infoLabels={"Title" : title,
                "Label": title,
                "Plot": plot})
            addLinkItem({"mode": "nop",
                "title": title.encode('utf8'),
                "thumbnail": thumbnail}, liStyle)
        else:
            liStyle = xbmcgui.ListItem("[COLOR blue]" + entry + " " + title + "[/COLOR]",
                thumbnailImage=thumbnail)
            liStyle.setInfo(type="Video", infoLabels={"Title" : title,
                "Label": title,
                "Plot": plot})
            addLinkItem({"mode": "play",
                "title": title.encode('utf8'),
                "url": videoUrl,
                "thumbnail": thumbnail}, liStyle)
    xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
Пример #3
0
def show_replay_epg(channelId, date):
    xbmc.log("Showing EPG for " + channelId + " on " + date)
    replay = Replay()
    programmes = replay.getProgrammes(channelId, date)

    for programme in programmes:
        if not programme:
            continue

        startTime = programme["timePublished"]
        title = programme["name"]

        if programme["images"]["landscape"] != "":
            thumb = programme["images"]["landscape"].replace(
                "[RESOLUTION]", "256x-")
        elif programme["isPartOf"] and programme["isPartOf"]["images"][
                "landscape"] != "":
            thumb = programme["isPartOf"]["images"]["landscape"].replace(
                "[RESOLUTION]", "256x-")
        else:
            raiplay = RaiPlay()
            thumb = raiplay.nothumb

        plot = programme["description"]

        if programme["hasVideo"]:
            videoUrl = programme["pathID"]
        else:
            videoUrl = None

        if videoUrl is None:
            # programme is not available
            liStyle = xbmcgui.ListItem(startTime + " [I]" + title + "[/I]",
                                       thumbnailImage=thumb)
            # liStyle.setInfo(type="Video", infoLabels={"Title" : title,
            # "Label": title,
            # "Plot": plot})
            liStyle.setProperty('IsPlayable', 'true')
            addLinkItem({"mode": "nop"}, liStyle)
        else:
            liStyle = xbmcgui.ListItem(startTime + " " + title,
                                       thumbnailImage=thumb)
            # liStyle.setInfo(type="Video", infoLabels={"Title" : title,
            # "Label": title,
            # "Plot": plot})
            liStyle.setProperty('IsPlayable', 'true')
            addLinkItem({"mode": "play", "path_id": videoUrl}, liStyle)
    xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
Пример #4
0
def show_replay_epg(channelId, date):
    replay = Replay()

    for station in tv_stations:
        if station["id"] == channelId:
            channelTag = station["tag"]
            break

    programmes = replay.getProgrammes(channelId, channelTag, date)

    # sort timetable
    timetable = utils.sortedDictKeys(programmes)

    for entry in timetable:
        recording = programmes[entry]

        title = recording["t"]
        plot = recording["d"]
        thumbnail = recording["image"]

        if recording["urlTablet"] != "":
            videoUrl = recording["urlTablet"]
        elif recording["h264"] != "":
            videoUrl = recording["h264"]
        else:
            videoUrl = None

        if videoUrl is None:
            # programme is not available
            liStyle = xbmcgui.ListItem(entry + " " + title,
                                       thumbnailImage=thumbnail)
            liStyle.setInfo(type="Video",
                            infoLabels={
                                "Title": title,
                                "Label": title,
                                "Plot": plot
                            })
            addLinkItem(
                {
                    "mode": "nop",
                    "title": title.encode('utf8'),
                    "thumbnail": thumbnail
                }, liStyle)
        else:
            liStyle = xbmcgui.ListItem("[COLOR blue]" + entry + " " + title +
                                       "[/COLOR]",
                                       thumbnailImage=thumbnail)
            liStyle.setInfo(type="Video",
                            infoLabels={
                                "Title": title,
                                "Label": title,
                                "Plot": plot
                            })
            addLinkItem(
                {
                    "mode": "play",
                    "title": title.encode('utf8'),
                    "url": videoUrl,
                    "thumbnail": thumbnail
                }, liStyle)
    xbmcplugin.endOfDirectory(handle=handle, succeeded=True)