1
0
mirror of https://github.com/fHDHR/fHDHR_NextPVR.git synced 2025-12-06 17:46:58 -05:00

EPG/XMLTV Tweaks

This commit is contained in:
deathbybandaid 2020-12-09 15:11:39 -05:00
parent bfdbeded3a
commit eb55403bee
2 changed files with 22 additions and 9 deletions

View File

@ -28,15 +28,16 @@ class EPG():
if method == "get":
epgdict = self.fhdhr.device.epg.get_epg(source)
epgdict = epgdict.copy()
for c in list(epgdict.keys()):
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", epgdict[c]["id"])
epgdict[chan_obj.dict["number"]] = epgdict.pop(c)
epgdict[chan_obj.dict["number"]]["name"] = chan_obj.dict["name"]
epgdict[chan_obj.dict["number"]]["callsign"] = chan_obj.dict["callsign"]
epgdict[chan_obj.dict["number"]]["number"] = chan_obj.dict["number"]
epgdict[chan_obj.dict["number"]]["id"] = chan_obj.dict["origin_id"]
epgdict[chan_obj.dict["number"]]["thumbnail"] = chan_obj.thumbnail
if source in ["blocks", "origin", self.fhdhr.config.dict["main"]["dictpopname"]]:
epgdict = epgdict.copy()
for c in list(epgdict.keys()):
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", epgdict[c]["id"])
epgdict[chan_obj.dict["number"]] = epgdict.pop(c)
epgdict[chan_obj.dict["number"]]["name"] = chan_obj.dict["name"]
epgdict[chan_obj.dict["number"]]["callsign"] = chan_obj.dict["callsign"]
epgdict[chan_obj.dict["number"]]["number"] = chan_obj.dict["number"]
epgdict[chan_obj.dict["number"]]["id"] = chan_obj.dict["origin_id"]
epgdict[chan_obj.dict["number"]]["thumbnail"] = chan_obj.thumbnail
epg_json = json.dumps(epgdict, indent=4)

View File

@ -38,6 +38,18 @@ class xmlTV():
if method == "get":
epgdict = self.fhdhr.device.epg.get_epg(source)
if source in ["blocks", "origin", self.fhdhr.config.dict["main"]["dictpopname"]]:
epgdict = epgdict.copy()
for c in list(epgdict.keys()):
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", epgdict[c]["id"])
epgdict[chan_obj.dict["number"]] = epgdict.pop(c)
epgdict[chan_obj.dict["number"]]["name"] = chan_obj.dict["name"]
epgdict[chan_obj.dict["number"]]["callsign"] = chan_obj.dict["callsign"]
epgdict[chan_obj.dict["number"]]["number"] = chan_obj.dict["number"]
epgdict[chan_obj.dict["number"]]["id"] = chan_obj.dict["origin_id"]
epgdict[chan_obj.dict["number"]]["thumbnail"] = chan_obj.thumbnail
xmltv_xml = self.create_xmltv(base_url, epgdict, source)
return Response(status=200,