1
0
mirror of https://github.com/fHDHR/fHDHR_NextPVR.git synced 2025-12-06 08:06:59 -05:00

Channel Creation timestamp and allow Origin to set Enablement

This commit is contained in:
deathbybandaid 2020-12-08 08:19:20 -05:00
parent 87f7c8f74d
commit 35c85b840c

View File

@ -1,3 +1,4 @@
import time
class Channel():
@ -15,6 +16,7 @@ class Channel():
self.channel_id = channel_id
self.dict = self.fhdhr.db.get_channel_value(str(channel_id), "dict") or self.default_dict
self.verify_dict()
self.fhdhr.db.set_channel_value(self.dict["id"], "dict", self.dict)
@property
@ -89,6 +91,13 @@ class Channel():
channel_info["HD"] = 0
self.dict["HD"] = channel_info["HD"]
if "enabled" in list(channel_info.keys()):
if "created" not in list(self.dict.keys()):
self.dict["enabled"] = channel_info["enabled"]
if "created" not in list(self.dict.keys()):
self.dict["created"] = time.time()
self.fhdhr.db.set_channel_value(self.dict["id"], "dict", self.dict)
@property