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)
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)
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)