mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 09:16:58 -05:00
commit
d101717e8f
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"web_ui":{
|
|
||||||
"theme":{
|
|
||||||
"value": "none",
|
|
||||||
"config_file": true,
|
|
||||||
"config_web": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -42,6 +42,7 @@ class Config():
|
|||||||
"origin_web": pathlib.Path(origin_dir).joinpath('origin_web'),
|
"origin_web": pathlib.Path(origin_dir).joinpath('origin_web'),
|
||||||
"cache_dir": pathlib.Path(data_dir).joinpath('cache'),
|
"cache_dir": pathlib.Path(data_dir).joinpath('cache'),
|
||||||
"internal_config": pathlib.Path(data_dir).joinpath('internal_config'),
|
"internal_config": pathlib.Path(data_dir).joinpath('internal_config'),
|
||||||
|
"fHDHR_web_dir": fHDHR_web_dir,
|
||||||
"www_dir": www_dir,
|
"www_dir": www_dir,
|
||||||
"www_templates_dir": pathlib.Path(fHDHR_web_dir).joinpath('templates'),
|
"www_templates_dir": pathlib.Path(fHDHR_web_dir).joinpath('templates'),
|
||||||
"font": pathlib.Path(data_dir).joinpath('garamond.ttf'),
|
"font": pathlib.Path(data_dir).joinpath('garamond.ttf'),
|
||||||
@ -52,6 +53,11 @@ class Config():
|
|||||||
if str(conffilepath).endswith(".json"):
|
if str(conffilepath).endswith(".json"):
|
||||||
self.read_json_config(conffilepath)
|
self.read_json_config(conffilepath)
|
||||||
|
|
||||||
|
for file_item in os.listdir(self.internal["paths"]["fHDHR_web_dir"]):
|
||||||
|
file_item_path = pathlib.Path(self.internal["paths"]["fHDHR_web_dir"]).joinpath(file_item)
|
||||||
|
if str(file_item_path).endswith("_conf.json"):
|
||||||
|
self.read_json_config(file_item_path)
|
||||||
|
|
||||||
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]):
|
||||||
@ -215,6 +221,22 @@ class Config():
|
|||||||
self.dict[each_section.lower()][each_key.lower()] = each_val
|
self.dict[each_section.lower()][each_key.lower()] = each_val
|
||||||
|
|
||||||
def write(self, section, key, value):
|
def write(self, section, key, value):
|
||||||
|
|
||||||
|
if not value:
|
||||||
|
value = None
|
||||||
|
if value.lower() in ["none"]:
|
||||||
|
value = None
|
||||||
|
elif value.lower() in ["false"]:
|
||||||
|
value = False
|
||||||
|
elif value.lower() in ["true"]:
|
||||||
|
value = True
|
||||||
|
elif isint(value):
|
||||||
|
value = int(value)
|
||||||
|
elif isfloat(value):
|
||||||
|
value = float(value)
|
||||||
|
elif isinstance(value, list):
|
||||||
|
",".join(value)
|
||||||
|
|
||||||
if section == self.dict["main"]["dictpopname"]:
|
if section == self.dict["main"]["dictpopname"]:
|
||||||
self.dict["origin"][key] = value
|
self.dict["origin"][key] = value
|
||||||
else:
|
else:
|
||||||
@ -226,7 +248,7 @@ class Config():
|
|||||||
if not config_handler.has_section(section):
|
if not config_handler.has_section(section):
|
||||||
config_handler.add_section(section)
|
config_handler.add_section(section)
|
||||||
|
|
||||||
config_handler.set(section, key, value)
|
config_handler.set(section, key, str(value))
|
||||||
|
|
||||||
with open(self.config_file, 'w') as config_file:
|
with open(self.config_file, 'w') as config_file:
|
||||||
config_handler.write(config_file)
|
config_handler.write(config_file)
|
||||||
|
|||||||
@ -25,9 +25,15 @@ class Channels():
|
|||||||
self.get_channels()
|
self.get_channels()
|
||||||
|
|
||||||
def get_channel_obj(self, keyfind, valfind):
|
def get_channel_obj(self, keyfind, valfind):
|
||||||
return next(self.list[fhdhr_id] for fhdhr_id in list(self.list.keys()) if self.list[fhdhr_id].dict[keyfind] == valfind)
|
if keyfind == "number":
|
||||||
|
return next(self.list[fhdhr_id] for fhdhr_id in list(self.list.keys()) if self.list[fhdhr_id].number == valfind) or None
|
||||||
|
else:
|
||||||
|
return next(self.list[fhdhr_id] for fhdhr_id in list(self.list.keys()) if self.list[fhdhr_id].dict[keyfind] == valfind) or None
|
||||||
|
|
||||||
def get_channel_list(self, keyfind):
|
def get_channel_list(self, keyfind):
|
||||||
|
if keyfind == "number":
|
||||||
|
return [self.list[x].number for x in list(self.list.keys())]
|
||||||
|
else:
|
||||||
return [self.list[x].dict[keyfind] for x in list(self.list.keys())]
|
return [self.list[x].dict[keyfind] for x in list(self.list.keys())]
|
||||||
|
|
||||||
def set_channel_status(self, keyfind, valfind, updatedict):
|
def set_channel_status(self, keyfind, valfind, updatedict):
|
||||||
|
|||||||
@ -14,11 +14,19 @@ class Channel():
|
|||||||
else:
|
else:
|
||||||
channel_id = id_system.assign()
|
channel_id = id_system.assign()
|
||||||
self.channel_id = channel_id
|
self.channel_id = channel_id
|
||||||
|
|
||||||
self.dict = self.fhdhr.db.get_channel_value(str(channel_id), "dict") or self.default_dict
|
self.dict = self.fhdhr.db.get_channel_value(str(channel_id), "dict") or self.default_dict
|
||||||
self.verify_dict()
|
self.verify_dict()
|
||||||
|
|
||||||
self.fhdhr.db.set_channel_value(self.dict["id"], "dict", self.dict)
|
self.fhdhr.db.set_channel_value(self.dict["id"], "dict", self.dict)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def number(self):
|
||||||
|
if self.dict["subnumber"]:
|
||||||
|
return "%s.%s" % (self.dict["number"], self.dict["subnumber"])
|
||||||
|
else:
|
||||||
|
return self.dict["number"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def thumbnail(self):
|
def thumbnail(self):
|
||||||
if str(self.dict["thumbnail"]).lower() in ["none"]:
|
if str(self.dict["thumbnail"]).lower() in ["none"]:
|
||||||
@ -35,9 +43,9 @@ class Channel():
|
|||||||
return {
|
return {
|
||||||
"callsign": self.dict["callsign"],
|
"callsign": self.dict["callsign"],
|
||||||
"name": self.dict["name"],
|
"name": self.dict["name"],
|
||||||
"number": self.dict["number"],
|
"number": self.number,
|
||||||
"id": self.dict["origin_id"],
|
"id": self.dict["origin_id"],
|
||||||
"thumbnail": self.dict["thumbnail"],
|
"thumbnail": self.thumbnail,
|
||||||
"listing": [],
|
"listing": [],
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,6 +57,10 @@ class Channel():
|
|||||||
for key in list(default_dict.keys()):
|
for key in list(default_dict.keys()):
|
||||||
if key not in list(self.dict.keys()):
|
if key not in list(self.dict.keys()):
|
||||||
self.dict[key] = default_dict[key]
|
self.dict[key] = default_dict[key]
|
||||||
|
if self.dict["number"]:
|
||||||
|
if "." in self.dict["number"]:
|
||||||
|
self.dict["subnumber"] = self.dict["number"].split(".")[1]
|
||||||
|
self.dict["number"] = self.dict["number"].split(".")[0]
|
||||||
|
|
||||||
def basics(self, channel_info):
|
def basics(self, channel_info):
|
||||||
"""Some Channel Information is Critical"""
|
"""Some Channel Information is Critical"""
|
||||||
@ -77,9 +89,17 @@ class Channel():
|
|||||||
|
|
||||||
if "number" not in list(channel_info.keys()):
|
if "number" not in list(channel_info.keys()):
|
||||||
channel_info["number"] = self.id_system.get_number(channel_info["id"])
|
channel_info["number"] = self.id_system.get_number(channel_info["id"])
|
||||||
self.dict["origin_number"] = str(float(channel_info["number"]))
|
self.dict["origin_number"] = str(channel_info["number"])
|
||||||
if not self.dict["number"]:
|
if not self.dict["number"]:
|
||||||
self.dict["number"] = self.dict["origin_number"]
|
self.dict["number"] = self.dict["origin_number"].split(".")[0]
|
||||||
|
try:
|
||||||
|
self.dict["subnumber"] = self.dict["origin_number"].split(".")[1]
|
||||||
|
except IndexError:
|
||||||
|
self.dict["subnumber"] = None
|
||||||
|
else:
|
||||||
|
if "." in self.dict["number"]:
|
||||||
|
self.dict["subnumber"] = self.dict["number"].split(".")[1]
|
||||||
|
self.dict["number"] = self.dict["number"].split(".")[0]
|
||||||
|
|
||||||
if "thumbnail" not in list(channel_info.keys()):
|
if "thumbnail" not in list(channel_info.keys()):
|
||||||
channel_info["thumbnail"] = None
|
channel_info["thumbnail"] = None
|
||||||
@ -106,7 +126,7 @@ class Channel():
|
|||||||
"id": str(self.channel_id), "origin_id": None,
|
"id": str(self.channel_id), "origin_id": None,
|
||||||
"name": None, "origin_name": None,
|
"name": None, "origin_name": None,
|
||||||
"callsign": None, "origin_callsign": None,
|
"callsign": None, "origin_callsign": None,
|
||||||
"number": None, "origin_number": None,
|
"number": None, "subnumber": None, "origin_number": None,
|
||||||
"tags": [], "origin_tags": [],
|
"tags": [], "origin_tags": [],
|
||||||
"thumbnail": None, "origin_thumbnail": None,
|
"thumbnail": None, "origin_thumbnail": None,
|
||||||
"enabled": True, "favorite": 0,
|
"enabled": True, "favorite": 0,
|
||||||
@ -123,14 +143,14 @@ class Channel():
|
|||||||
def set_status(self, updatedict):
|
def set_status(self, updatedict):
|
||||||
for key in list(updatedict.keys()):
|
for key in list(updatedict.keys()):
|
||||||
if key == "number":
|
if key == "number":
|
||||||
updatedict[key] = str(float(updatedict[key]))
|
updatedict[key] = str(updatedict[key])
|
||||||
self.dict[key] = updatedict[key]
|
self.dict[key] = updatedict[key]
|
||||||
self.fhdhr.db.set_channel_value(self.dict["id"], "dict", self.dict)
|
self.fhdhr.db.set_channel_value(self.dict["id"], "dict", self.dict)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lineup_dict(self):
|
def lineup_dict(self):
|
||||||
return {
|
return {
|
||||||
'GuideNumber': self.dict['number'],
|
'GuideNumber': self.number,
|
||||||
'GuideName': self.dict['name'],
|
'GuideName': self.dict['name'],
|
||||||
'Tags': ",".join(self.dict['tags']),
|
'Tags': ",".join(self.dict['tags']),
|
||||||
'URL': self.stream_url,
|
'URL': self.stream_url,
|
||||||
@ -140,15 +160,15 @@ class Channel():
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def generic_image_url(self):
|
def generic_image_url(self):
|
||||||
return "/api/images?method=generate&type=channel&message=%s" % self.dict["number"]
|
return "/api/images?method=generate&type=channel&message=%s" % self.number
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def stream_url(self):
|
def stream_url(self):
|
||||||
return '/auto/v%s' % self.dict['number']
|
return '/auto/v%s' % self.number
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def play_url(self):
|
def play_url(self):
|
||||||
return '/api/m3u?method=get&channel=%s' % self.dict['number']
|
return '/api/m3u?method=get&channel=%s' % self.number
|
||||||
|
|
||||||
def set_favorite(self, enablement):
|
def set_favorite(self, enablement):
|
||||||
if enablement == "+":
|
if enablement == "+":
|
||||||
|
|||||||
@ -60,15 +60,18 @@ class EPG():
|
|||||||
|
|
||||||
self.fhdhr.db.delete_fhdhr_value("epg_dict", method)
|
self.fhdhr.db.delete_fhdhr_value("epg_dict", method)
|
||||||
|
|
||||||
def whats_on_now(self, channel, method=None):
|
def whats_on_now(self, channel_number, method=None):
|
||||||
epgdict = self.get_epg(method)
|
|
||||||
listings = epgdict[channel]["listing"]
|
|
||||||
for listing in listings:
|
|
||||||
nowtime = datetime.datetime.utcnow()
|
nowtime = datetime.datetime.utcnow()
|
||||||
|
epgdict = self.get_epg(method)
|
||||||
|
try:
|
||||||
|
listings = epgdict[channel_number]["listing"]
|
||||||
|
except KeyError:
|
||||||
|
listings = []
|
||||||
|
for listing in listings:
|
||||||
start_time = datetime.datetime.strptime(listing["time_start"], '%Y%m%d%H%M%S +0000')
|
start_time = datetime.datetime.strptime(listing["time_start"], '%Y%m%d%H%M%S +0000')
|
||||||
end_time = datetime.datetime.strptime(listing["time_end"], '%Y%m%d%H%M%S +0000')
|
end_time = datetime.datetime.strptime(listing["time_end"], '%Y%m%d%H%M%S +0000')
|
||||||
if start_time <= nowtime <= end_time:
|
if start_time <= nowtime <= end_time:
|
||||||
epgitem = epgdict[channel].copy()
|
epgitem = epgdict[channel_number].copy()
|
||||||
epgitem["listing"] = [listing]
|
epgitem["listing"] = [listing]
|
||||||
return epgitem
|
return epgitem
|
||||||
return None
|
return None
|
||||||
@ -83,9 +86,18 @@ class EPG():
|
|||||||
|
|
||||||
channel_guide_list = []
|
channel_guide_list = []
|
||||||
epgdict = self.get_epg(method)
|
epgdict = self.get_epg(method)
|
||||||
channels = list(epgdict.keys())
|
if method in ["blocks", "origin", self.fhdhr.config.dict["main"]["dictpopname"]]:
|
||||||
for channel in channels:
|
epgdict = epgdict.copy()
|
||||||
whatson = self.whats_on_now(epgdict[channel]["number"], method)
|
for c in list(epgdict.keys()):
|
||||||
|
chan_obj = self.channels.get_channel_obj("origin_id", epgdict[c]["id"])
|
||||||
|
epgdict[chan_obj.number] = epgdict.pop(c)
|
||||||
|
epgdict[chan_obj.number]["name"] = chan_obj.dict["name"]
|
||||||
|
epgdict[chan_obj.number]["callsign"] = chan_obj.dict["callsign"]
|
||||||
|
epgdict[chan_obj.number]["number"] = chan_obj.number
|
||||||
|
epgdict[chan_obj.number]["id"] = chan_obj.dict["origin_id"]
|
||||||
|
epgdict[chan_obj.number]["thumbnail"] = chan_obj.thumbnail
|
||||||
|
for channel_number in list(epgdict.keys()):
|
||||||
|
whatson = self.whats_on_now(channel_number, method)
|
||||||
if whatson:
|
if whatson:
|
||||||
channel_guide_list.append(whatson)
|
channel_guide_list.append(whatson)
|
||||||
return channel_guide_list
|
return channel_guide_list
|
||||||
@ -121,17 +133,15 @@ class EPG():
|
|||||||
|
|
||||||
def find_channel_dict(self, channel_id):
|
def find_channel_dict(self, channel_id):
|
||||||
epgdict = self.get_epg()
|
epgdict = self.get_epg()
|
||||||
channel_list = []
|
channel_list = [epgdict[x] for x in list(epgdict.keys())]
|
||||||
for channel in list(epgdict.keys()):
|
return next(item for item in channel_list if item["id"] == channel_id) or None
|
||||||
channel_list.append(epgdict[channel])
|
|
||||||
return next(item for item in channel_list if item["id"] == channel_id)
|
|
||||||
|
|
||||||
def find_program_dict(self, event_id):
|
def find_program_dict(self, event_id):
|
||||||
epgdict = self.get_epg()
|
epgdict = self.get_epg()
|
||||||
event_list = []
|
event_list = []
|
||||||
for channel in list(epgdict.keys()):
|
for channel in list(epgdict.keys()):
|
||||||
event_list.extend(epgdict[channel]["listing"])
|
event_list.extend(epgdict[channel]["listing"])
|
||||||
return next(item for item in event_list if item["id"] == event_id)
|
return next(item for item in event_list if item["id"] == event_id) or None
|
||||||
|
|
||||||
def epg_method_selfadd(self):
|
def epg_method_selfadd(self):
|
||||||
self.fhdhr.logger.info("Checking for Alternative EPG methods.")
|
self.fhdhr.logger.info("Checking for Alternative EPG methods.")
|
||||||
@ -166,11 +176,6 @@ class EPG():
|
|||||||
else:
|
else:
|
||||||
programguide = self.epg_handling[method].update_epg()
|
programguide = self.epg_handling[method].update_epg()
|
||||||
|
|
||||||
for chan in list(programguide.keys()):
|
|
||||||
floatnum = str(float(chan))
|
|
||||||
programguide[floatnum] = programguide.pop(chan)
|
|
||||||
programguide[floatnum]["number"] = floatnum
|
|
||||||
|
|
||||||
programguide = OrderedDict(sorted(programguide.items()))
|
programguide = OrderedDict(sorted(programguide.items()))
|
||||||
|
|
||||||
for cnum in programguide:
|
for cnum in programguide:
|
||||||
|
|||||||
@ -16,12 +16,12 @@ class blocksEPG():
|
|||||||
for fhdhr_id in list(self.channels.list.keys()):
|
for fhdhr_id in list(self.channels.list.keys()):
|
||||||
chan_obj = self.channels.list[fhdhr_id]
|
chan_obj = self.channels.list[fhdhr_id]
|
||||||
|
|
||||||
if str(chan_obj.dict["number"]) not in list(programguide.keys()):
|
if str(chan_obj.number) not in list(programguide.keys()):
|
||||||
programguide[str(chan_obj.dict["number"])] = chan_obj.epgdict
|
programguide[str(chan_obj.number)] = chan_obj.epgdict
|
||||||
|
|
||||||
clean_prog_dicts = self.empty_channel_epg(timestamps, chan_obj)
|
clean_prog_dicts = self.empty_channel_epg(timestamps, chan_obj)
|
||||||
for clean_prog_dict in clean_prog_dicts:
|
for clean_prog_dict in clean_prog_dicts:
|
||||||
programguide[str(chan_obj.dict["number"])]["listing"].append(clean_prog_dict)
|
programguide[str(chan_obj.number)]["listing"].append(clean_prog_dict)
|
||||||
|
|
||||||
return programguide
|
return programguide
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,12 @@ class Channels():
|
|||||||
if key in ["name", "callsign", "thumbnail"]:
|
if key in ["name", "callsign", "thumbnail"]:
|
||||||
updatedict[key] = str(request.form.get(key))
|
updatedict[key] = str(request.form.get(key))
|
||||||
elif key in ["number"]:
|
elif key in ["number"]:
|
||||||
updatedict[key] = float(request.form.get(key))
|
number = str(request.form.get(key))
|
||||||
|
if "." in number:
|
||||||
|
updatedict["subnumber"] = number.split(".")[1]
|
||||||
|
updatedict["number"] = number.split(".")[0]
|
||||||
|
else:
|
||||||
|
updatedict["number"] = number
|
||||||
elif key in ["enabled"]:
|
elif key in ["enabled"]:
|
||||||
confvalue = request.form.get(key)
|
confvalue = request.form.get(key)
|
||||||
if str(confvalue).lower() in ["false"]:
|
if str(confvalue).lower() in ["false"]:
|
||||||
|
|||||||
@ -32,12 +32,12 @@ class EPG():
|
|||||||
epgdict = epgdict.copy()
|
epgdict = epgdict.copy()
|
||||||
for c in list(epgdict.keys()):
|
for c in list(epgdict.keys()):
|
||||||
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", epgdict[c]["id"])
|
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.number] = epgdict.pop(c)
|
||||||
epgdict[chan_obj.dict["number"]]["name"] = chan_obj.dict["name"]
|
epgdict[chan_obj.number]["name"] = chan_obj.dict["name"]
|
||||||
epgdict[chan_obj.dict["number"]]["callsign"] = chan_obj.dict["callsign"]
|
epgdict[chan_obj.number]["callsign"] = chan_obj.dict["callsign"]
|
||||||
epgdict[chan_obj.dict["number"]]["number"] = chan_obj.dict["number"]
|
epgdict[chan_obj.number]["number"] = chan_obj.number
|
||||||
epgdict[chan_obj.dict["number"]]["id"] = chan_obj.dict["origin_id"]
|
epgdict[chan_obj.number]["id"] = chan_obj.dict["origin_id"]
|
||||||
epgdict[chan_obj.dict["number"]]["thumbnail"] = chan_obj.thumbnail
|
epgdict[chan_obj.number]["thumbnail"] = chan_obj.thumbnail
|
||||||
|
|
||||||
epg_json = json.dumps(epgdict, indent=4)
|
epg_json = json.dumps(epgdict, indent=4)
|
||||||
|
|
||||||
|
|||||||
@ -43,12 +43,12 @@ class xmlTV():
|
|||||||
epgdict = epgdict.copy()
|
epgdict = epgdict.copy()
|
||||||
for c in list(epgdict.keys()):
|
for c in list(epgdict.keys()):
|
||||||
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", epgdict[c]["id"])
|
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.number] = epgdict.pop(c)
|
||||||
epgdict[chan_obj.dict["number"]]["name"] = chan_obj.dict["name"]
|
epgdict[chan_obj.number]["name"] = chan_obj.dict["name"]
|
||||||
epgdict[chan_obj.dict["number"]]["callsign"] = chan_obj.dict["callsign"]
|
epgdict[chan_obj.number]["callsign"] = chan_obj.dict["callsign"]
|
||||||
epgdict[chan_obj.dict["number"]]["number"] = chan_obj.dict["number"]
|
epgdict[chan_obj.number]["number"] = chan_obj.number
|
||||||
epgdict[chan_obj.dict["number"]]["id"] = chan_obj.dict["origin_id"]
|
epgdict[chan_obj.number]["id"] = chan_obj.dict["origin_id"]
|
||||||
epgdict[chan_obj.dict["number"]]["thumbnail"] = chan_obj.thumbnail
|
epgdict[chan_obj.number]["thumbnail"] = chan_obj.thumbnail
|
||||||
|
|
||||||
xmltv_xml = self.create_xmltv(base_url, epgdict, source)
|
xmltv_xml = self.create_xmltv(base_url, epgdict, source)
|
||||||
|
|
||||||
@ -100,12 +100,12 @@ class xmlTV():
|
|||||||
if source in ["origin", "blocks", self.fhdhr.config.dict["main"]["dictpopname"]]:
|
if source in ["origin", "blocks", self.fhdhr.config.dict["main"]["dictpopname"]]:
|
||||||
for c in list(epgdict.keys()):
|
for c in list(epgdict.keys()):
|
||||||
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", epgdict[c]["id"])
|
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.number] = epgdict.pop(c)
|
||||||
epgdict[chan_obj.dict["number"]]["name"] = chan_obj.dict["name"]
|
epgdict[chan_obj.number]["name"] = chan_obj.dict["name"]
|
||||||
epgdict[chan_obj.dict["number"]]["callsign"] = chan_obj.dict["callsign"]
|
epgdict[chan_obj.number]["callsign"] = chan_obj.dict["callsign"]
|
||||||
epgdict[chan_obj.dict["number"]]["number"] = chan_obj.dict["number"]
|
epgdict[chan_obj.number]["number"] = chan_obj.number
|
||||||
epgdict[chan_obj.dict["number"]]["id"] = chan_obj.dict["origin_id"]
|
epgdict[chan_obj.number]["id"] = chan_obj.dict["origin_id"]
|
||||||
epgdict[chan_obj.dict["number"]]["thumbnail"] = chan_obj.thumbnail
|
epgdict[chan_obj.number]["thumbnail"] = chan_obj.thumbnail
|
||||||
|
|
||||||
for c in list(epgdict.keys()):
|
for c in list(epgdict.keys()):
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,11 @@ class Channels_Editor_HTML():
|
|||||||
for fhdhr_id in list(self.fhdhr.device.channels.list.keys()):
|
for fhdhr_id in list(self.fhdhr.device.channels.list.keys()):
|
||||||
channel_obj = self.fhdhr.device.channels.list[fhdhr_id]
|
channel_obj = self.fhdhr.device.channels.list[fhdhr_id]
|
||||||
channel_dict = channel_obj.dict.copy()
|
channel_dict = channel_obj.dict.copy()
|
||||||
|
|
||||||
|
channel_dict["number"] = channel_obj.number
|
||||||
|
channel_dict["chan_thumbnail"] = channel_obj.thumbnail
|
||||||
channel_dict["play_url"] = channel_obj.play_url
|
channel_dict["play_url"] = channel_obj.play_url
|
||||||
|
|
||||||
channelslist.append(channel_dict)
|
channelslist.append(channel_dict)
|
||||||
|
|
||||||
return render_template('channels_editor.html', request=request, fhdhr=self.fhdhr, channelslist=channelslist)
|
return render_template('channels_editor.html', request=request, fhdhr=self.fhdhr, channelslist=channelslist)
|
||||||
|
|||||||
@ -22,7 +22,11 @@ class Channels_HTML():
|
|||||||
for fhdhr_id in list(self.fhdhr.device.channels.list.keys()):
|
for fhdhr_id in list(self.fhdhr.device.channels.list.keys()):
|
||||||
channel_obj = self.fhdhr.device.channels.list[fhdhr_id]
|
channel_obj = self.fhdhr.device.channels.list[fhdhr_id]
|
||||||
channel_dict = channel_obj.dict.copy()
|
channel_dict = channel_obj.dict.copy()
|
||||||
|
|
||||||
|
channel_dict["number"] = channel_obj.number
|
||||||
|
channel_dict["chan_thumbnail"] = channel_obj.thumbnail
|
||||||
channel_dict["play_url"] = channel_obj.play_url
|
channel_dict["play_url"] = channel_obj.play_url
|
||||||
|
|
||||||
channelslist.append(channel_dict)
|
channelslist.append(channel_dict)
|
||||||
if channel_dict["enabled"]:
|
if channel_dict["enabled"]:
|
||||||
channels_dict["Enabled"] += 1
|
channels_dict["Enabled"] += 1
|
||||||
|
|||||||
@ -42,7 +42,7 @@ class Guide_HTML():
|
|||||||
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", channel["id"])
|
chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", channel["id"])
|
||||||
|
|
||||||
chan_dict["name"] = chan_obj.dict["name"]
|
chan_dict["name"] = chan_obj.dict["name"]
|
||||||
chan_dict["number"] = chan_obj.dict["number"]
|
chan_dict["number"] = chan_obj.number
|
||||||
chan_dict["chan_thumbnail"] = chan_obj.thumbnail
|
chan_dict["chan_thumbnail"] = chan_obj.thumbnail
|
||||||
chan_dict["enabled"] = chan_obj.dict["enabled"]
|
chan_dict["enabled"] = chan_obj.dict["enabled"]
|
||||||
chan_dict["play_url"] = chan_obj.play_url
|
chan_dict["play_url"] = chan_obj.play_url
|
||||||
|
|||||||
@ -27,10 +27,10 @@ class RMG_Devices_DeviceKey_Channels():
|
|||||||
if channel_obj.enabled:
|
if channel_obj.enabled:
|
||||||
sub_el(out, 'Channel',
|
sub_el(out, 'Channel',
|
||||||
drm="0",
|
drm="0",
|
||||||
channelIdentifier="id://%s" % channel_obj.dict["number"],
|
channelIdentifier="id://%s" % channel_obj.number,
|
||||||
name=channel_obj.dict["name"],
|
name=channel_obj.dict["name"],
|
||||||
origin=channel_obj.dict["callsign"],
|
origin=channel_obj.dict["callsign"],
|
||||||
number=str(channel_obj.dict["number"]),
|
number=str(channel_obj.number),
|
||||||
type="tv",
|
type="tv",
|
||||||
# TODO param
|
# TODO param
|
||||||
signalStrength="100",
|
signalStrength="100",
|
||||||
|
|||||||
@ -17,23 +17,52 @@
|
|||||||
<p></p>
|
<p></p>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/')">fHDHR</a></button>
|
<button class="pull-left" onclick="OpenLink('/index')">fHDHR</a></button>
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/origin')">{{ fhdhr.config.dict["main"]["servicename"] }}</a></button>
|
<button class="pull-left" onclick="OpenLink('/origin')">{{ fhdhr.config.dict["main"]["servicename"] }}</a></button>
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/channels')">Channels</a></button>
|
<button class="pull-left" onclick="OpenLink('/channels')">Channels</a></button>
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/guide')">Guide</a></button>
|
<button class="pull-left" onclick="OpenLink('/guide')">Guide</a></button>
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/cluster')">Cluster/SSDP</a></button>
|
<button class="pull-left" onclick="OpenLink('/cluster')">Cluster/SSDP</a></button>
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/tuners')">Tuners</a></button>
|
<button class="pull-left" onclick="OpenLink('/tuners')">Tuners</a></button>
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/xmltv')">xmltv</a></button>
|
<button class="pull-left" onclick="OpenLink('/xmltv')">xmltv</a></button>
|
||||||
|
|
||||||
|
{% if fhdhr.config.dict["web_ui"]["advanced"] %}
|
||||||
<button class="pull-left" onclick="OpenLink('/version')">Version</a></button>
|
<button class="pull-left" onclick="OpenLink('/version')">Version</a></button>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if fhdhr.config.dict["web_ui"]["advanced"] %}
|
||||||
<button class="pull-left" onclick="OpenLink('/diagnostics')">Diagnostics</a></button>
|
<button class="pull-left" onclick="OpenLink('/diagnostics')">Diagnostics</a></button>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/settings')">Settings</a></button>
|
<button class="pull-left" onclick="OpenLink('/settings')">Settings</a></button>
|
||||||
|
|
||||||
<a class="pull-right" style="padding: 5px;" href="/api/xmltv?method=get&source={{ fhdhr.device.epg.def_method }}">xmltv</a>
|
<a class="pull-right" style="padding: 5px;" href="/api/xmltv?method=get&source={{ fhdhr.device.epg.def_method }}">xmltv</a>
|
||||||
<a class="pull-right" style="padding: 5px;" href="/api/m3u?method=get&channel=all">m3u</a>
|
<a class="pull-right" style="padding: 5px;" href="/api/m3u?method=get&channel=all">m3u</a>
|
||||||
|
<form class="pull-right" style="padding: 5px;" method="post" action="/api/settings?method=update&redirect={{ request.path }}">
|
||||||
|
<input type="hidden" name="config_section" value="web_ui">
|
||||||
|
<input type="hidden" name="config_name" value="advanced">
|
||||||
|
{% if fhdhr.config.dict["web_ui"]["advanced"] %}
|
||||||
|
<input type="hidden" name="config_value" value=False>
|
||||||
|
{% else %}
|
||||||
|
<input type="hidden" name="config_value" value=True>
|
||||||
|
{% endif %}
|
||||||
|
<input type="hidden" name="config_default" value=False>
|
||||||
|
{% if fhdhr.config.dict["web_ui"]["advanced"] %}
|
||||||
|
<a data-th="Reset"><input type="submit" value="Basic"></a>
|
||||||
|
{% else %}
|
||||||
|
<a data-th="Reset"><input type="submit" value="Advanced"></a>
|
||||||
|
{% endif %}
|
||||||
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<hr align="center" width="100%">
|
<hr align="center" width="100%">
|
||||||
|
|
||||||
|
{% if fhdhr.config.dict["web_ui"]["cluster_bar"] %}
|
||||||
{% set locations = fhdhr.device.cluster.get_cluster_dicts_web() %}
|
{% set locations = fhdhr.device.cluster.get_cluster_dicts_web() %}
|
||||||
{% if locations %}
|
{% if locations %}
|
||||||
<div>
|
<div>
|
||||||
@ -43,6 +72,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr align="center" width="100%">
|
<hr align="center" width="100%">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% set retmessage = request.args.get('retmessage', default=None) %}
|
{% set retmessage = request.args.get('retmessage', default=None) %}
|
||||||
{% if retmessage %}
|
{% if retmessage %}
|
||||||
|
|||||||
20
fHDHR_web/web_ui_conf.json
Normal file
20
fHDHR_web/web_ui_conf.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"web_ui":{
|
||||||
|
"theme":{
|
||||||
|
"value": "none",
|
||||||
|
"config_file": true,
|
||||||
|
"config_web": true
|
||||||
|
},
|
||||||
|
"advanced":{
|
||||||
|
"value": false,
|
||||||
|
"config_file": true,
|
||||||
|
"config_web": true
|
||||||
|
}
|
||||||
|
,
|
||||||
|
"cluster_bar":{
|
||||||
|
"value": true,
|
||||||
|
"config_file": true,
|
||||||
|
"config_web": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user