mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 11:16:58 -05:00
Improve Missing Channel EPG System
This commit is contained in:
parent
a8972371c2
commit
55ca03b389
@ -74,7 +74,25 @@ class EPG():
|
||||
epgitem = epgdict[channel_number].copy()
|
||||
epgitem["listing"] = [listing]
|
||||
return epgitem
|
||||
return None
|
||||
epgitem = epgdict[channel_number].copy()
|
||||
epgitem["listing"] = [{
|
||||
"time_start": None,
|
||||
"time_end": None,
|
||||
"duration_minutes": None,
|
||||
"thumbnail": None,
|
||||
"title": "Unavailable",
|
||||
"sub-title": "Unavailable",
|
||||
"description": "Unavailable",
|
||||
"rating": "N/A",
|
||||
"episodetitle": None,
|
||||
"releaseyear": None,
|
||||
"genres": [],
|
||||
"seasonnumber": None,
|
||||
"episodenumber": None,
|
||||
"isnew": False,
|
||||
"id": None,
|
||||
}]
|
||||
return epgitem
|
||||
|
||||
def whats_on_allchans(self, method=None):
|
||||
|
||||
@ -181,6 +199,14 @@ class EPG():
|
||||
for cnum in programguide:
|
||||
programguide[cnum]["listing"] = sorted(programguide[cnum]["listing"], key=lambda i: i['time_start'])
|
||||
|
||||
if method in ["blocks", "origin", self.fhdhr.config.dict["main"]["dictpopname"]]:
|
||||
|
||||
for fhdhr_id in list(self.channels.list.keys()):
|
||||
chan_obj = self.channels.list[fhdhr_id]
|
||||
|
||||
if str(chan_obj.number) not in list(programguide.keys()):
|
||||
programguide[str(chan_obj.number)] = chan_obj.epgdict
|
||||
|
||||
self.epgdict = programguide
|
||||
self.fhdhr.db.set_fhdhr_value("epg_dict", method, programguide)
|
||||
self.fhdhr.db.set_fhdhr_value("update_time", method, time.time())
|
||||
|
||||
@ -26,8 +26,11 @@ class Guide_HTML():
|
||||
source = self.fhdhr.device.epg.def_method
|
||||
|
||||
for channel in self.fhdhr.device.epg.whats_on_allchans(source):
|
||||
if channel["listing"][0]["time_end"]:
|
||||
end_time = datetime.datetime.strptime(channel["listing"][0]["time_end"], '%Y%m%d%H%M%S +0000')
|
||||
remaining_time = humanized_time(int((end_time - nowtime).total_seconds()))
|
||||
else:
|
||||
remaining_time = "N/A"
|
||||
|
||||
chan_dict = {
|
||||
"name": channel["name"],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user