test
This commit is contained in:
parent
f4dc35de58
commit
304919b3b4
@ -53,9 +53,15 @@ class Config():
|
|||||||
for dir_type in ["alternative_epg", "origin"]:
|
for dir_type in ["alternative_epg", "origin"]:
|
||||||
|
|
||||||
for file_item in os.listdir(self.internal["paths"][dir_type]):
|
for file_item in os.listdir(self.internal["paths"][dir_type]):
|
||||||
file_item_path = os.path.join(self.internal["paths"][dir_type], file_item)
|
file_item_path = pathlib.Path(self.internal["paths"][dir_type]).joinpath(file_item)
|
||||||
if str(file_item_path).endswith("_conf.json"):
|
if file_item_path.is_dir():
|
||||||
self.read_json_config(file_item_path)
|
for sub_file_item in os.listdir(file_item_path):
|
||||||
|
sub_file_item_path = pathlib.Path(file_item_path).joinpath(sub_file_item)
|
||||||
|
if str(sub_file_item_path).endswith("_conf.json"):
|
||||||
|
self.read_json_config(sub_file_item_path)
|
||||||
|
else:
|
||||||
|
if str(file_item_path).endswith("_conf.json"):
|
||||||
|
self.read_json_config(file_item_path)
|
||||||
|
|
||||||
print("Loading Configuration File: " + str(self.config_file))
|
print("Loading Configuration File: " + str(self.config_file))
|
||||||
self.read_ini_config(self.config_file)
|
self.read_ini_config(self.config_file)
|
||||||
|
|||||||
@ -140,6 +140,9 @@ class EPG():
|
|||||||
if entry.is_file():
|
if entry.is_file():
|
||||||
if entry.name[0] != '_' and entry.name.endswith(".py"):
|
if entry.name[0] != '_' and entry.name.endswith(".py"):
|
||||||
new_epgtype_list.append(str(entry.name[:-3]))
|
new_epgtype_list.append(str(entry.name[:-3]))
|
||||||
|
elif entry.is_dir():
|
||||||
|
if entry.name[0] != '_':
|
||||||
|
new_epgtype_list.append(str(entry.name))
|
||||||
for method in new_epgtype_list:
|
for method in new_epgtype_list:
|
||||||
self.fhdhr.logger.info("Found %s EPG method." % method)
|
self.fhdhr.logger.info("Found %s EPG method." % method)
|
||||||
self.epg_handling[method] = eval("self.alternative_epg.%s.%sEPG(self.fhdhr, self.channels)" % (method, method))
|
self.epg_handling[method] = eval("self.alternative_epg.%s.%sEPG(self.fhdhr, self.channels)" % (method, method))
|
||||||
|
|||||||
@ -28,15 +28,16 @@ class EPG():
|
|||||||
if method == "get":
|
if method == "get":
|
||||||
|
|
||||||
epgdict = self.fhdhr.device.epg.get_epg(source)
|
epgdict = self.fhdhr.device.epg.get_epg(source)
|
||||||
epgdict = epgdict.copy()
|
if source in ["blocks", "origin", self.fhdhr.config.dict["main"]["dictpopname"]]:
|
||||||
for c in list(epgdict.keys()):
|
epgdict = epgdict.copy()
|
||||||
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", epgdict[c]["id"])
|
for c in list(epgdict.keys()):
|
||||||
epgdict[chan_obj.dict["number"]] = epgdict.pop(c)
|
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", epgdict[c]["id"])
|
||||||
epgdict[chan_obj.dict["number"]]["name"] = chan_obj.dict["name"]
|
epgdict[chan_obj.dict["number"]] = epgdict.pop(c)
|
||||||
epgdict[chan_obj.dict["number"]]["callsign"] = chan_obj.dict["callsign"]
|
epgdict[chan_obj.dict["number"]]["name"] = chan_obj.dict["name"]
|
||||||
epgdict[chan_obj.dict["number"]]["number"] = chan_obj.dict["number"]
|
epgdict[chan_obj.dict["number"]]["callsign"] = chan_obj.dict["callsign"]
|
||||||
epgdict[chan_obj.dict["number"]]["id"] = chan_obj.dict["origin_id"]
|
epgdict[chan_obj.dict["number"]]["number"] = chan_obj.dict["number"]
|
||||||
epgdict[chan_obj.dict["number"]]["thumbnail"] = chan_obj.thumbnail
|
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)
|
epg_json = json.dumps(epgdict, indent=4)
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,18 @@ class xmlTV():
|
|||||||
if method == "get":
|
if method == "get":
|
||||||
|
|
||||||
epgdict = self.fhdhr.device.epg.get_epg(source)
|
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)
|
xmltv_xml = self.create_xmltv(base_url, epgdict, source)
|
||||||
|
|
||||||
return Response(status=200,
|
return Response(status=200,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user