From aaedc7542ffe4d1686b23136fafb0b4a2c467c61 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Mon, 5 Oct 2020 15:54:29 -0400 Subject: [PATCH] Verify Scheduling Order --- epghandler/epgtypes/empty.py | 3 +++ epghandler/epgtypes/zap2it.py | 3 +++ proxyservice/__init__.py | 3 +++ 3 files changed, 9 insertions(+) diff --git a/epghandler/epgtypes/empty.py b/epghandler/epgtypes/empty.py index bf6da2b..df90a33 100644 --- a/epghandler/epgtypes/empty.py +++ b/epghandler/epgtypes/empty.py @@ -85,6 +85,9 @@ class EmptyEPG(): programguide[str(c["number"])]["listing"].append(clean_prog_dict) + for cnum in programguide: + programguide[cnum]["listing"] = sorted(programguide[cnum]["listing"], key=lambda i: i['time_start']) + self.epg_cache = programguide with open(self.epg_cache_file, 'w') as epgfile: epgfile.write(json.dumps(programguide, indent=4)) diff --git a/epghandler/epgtypes/zap2it.py b/epghandler/epgtypes/zap2it.py index b086756..09a22d7 100644 --- a/epghandler/epgtypes/zap2it.py +++ b/epghandler/epgtypes/zap2it.py @@ -198,6 +198,9 @@ class ZapEPG(): programguide[str(cdict["channelNo"])]["listing"].append(clean_prog_dict) + for cnum in programguide: + programguide[cnum]["listing"] = sorted(programguide[cnum]["listing"], key=lambda i: i['time_start']) + self.epg_cache = programguide with open(self.epg_cache_file, 'w') as epgfile: epgfile.write(json.dumps(programguide, indent=4)) diff --git a/proxyservice/__init__.py b/proxyservice/__init__.py index 7ac2e65..eeb8b98 100644 --- a/proxyservice/__init__.py +++ b/proxyservice/__init__.py @@ -294,6 +294,9 @@ class proxyserviceFetcher(): programguide[str(cdict["number"])]["listing"].append(clean_prog_dict) + for cnum in programguide: + programguide[cnum]["listing"] = sorted(programguide[cnum]["listing"], key=lambda i: i['time_start']) + self.epg_cache = programguide with open(self.epg_cache_file, 'w') as epgfile: epgfile.write(json.dumps(programguide, indent=4))