test
This commit is contained in:
parent
1df65f653e
commit
c66545f63a
@ -139,6 +139,16 @@ class OriginEPG():
|
|||||||
|
|
||||||
return programguide
|
return programguide
|
||||||
|
|
||||||
|
def toonami_calculate_duration(self, start_time, end_time):
|
||||||
|
start_time = start_time.replace('Z', '+00:00')
|
||||||
|
start_time = datetime.datetime.fromisoformat(start_time)
|
||||||
|
|
||||||
|
end_time = end_time.replace('Z', '+00:00')
|
||||||
|
end_time = datetime.datetime.fromisoformat(end_time)
|
||||||
|
|
||||||
|
duration = (end_time - start_time).total_seconds() / 60
|
||||||
|
return duration
|
||||||
|
|
||||||
def xmltimestamp_toonami(self, inputtime):
|
def xmltimestamp_toonami(self, inputtime):
|
||||||
xmltime = inputtime.replace('Z', '+00:00')
|
xmltime = inputtime.replace('Z', '+00:00')
|
||||||
xmltime = datetime.datetime.fromisoformat(xmltime)
|
xmltime = datetime.datetime.fromisoformat(xmltime)
|
||||||
@ -146,12 +156,12 @@ class OriginEPG():
|
|||||||
return xmltime
|
return xmltime
|
||||||
|
|
||||||
def get_prog_timedict(self, starttime, endtime):
|
def get_prog_timedict(self, starttime, endtime):
|
||||||
print(self.xmltimestamp_toonami(starttime))
|
|
||||||
timedict = {
|
timedict = {
|
||||||
"time_start": self.xmltimestamp_toonami(starttime),
|
"time_start": self.xmltimestamp_toonami(starttime),
|
||||||
"time_end": self.xmltimestamp_toonami(endtime)
|
"time_end": self.xmltimestamp_toonami(endtime),
|
||||||
|
"duration": self.toonami_calculate_duration(starttime, endtime)
|
||||||
}
|
}
|
||||||
timedict["duration"] = (timedict["time_end"] - timedict["time_start"])
|
print(timedict)
|
||||||
return timedict
|
return timedict
|
||||||
|
|
||||||
def get_cached(self, jsonid, cache_key, url):
|
def get_cached(self, jsonid, cache_key, url):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user