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

Skip Channel Scan on startup after initial run, unless configured

This commit is contained in:
deathbybandaid 2020-11-28 11:28:35 -05:00
parent a564e039df
commit 32c40251c7
2 changed files with 11 additions and 2 deletions

View File

@ -61,7 +61,12 @@
"value": false, "value": false,
"config_file": true, "config_file": true,
"config_web": true "config_web": true
} },
"chanscan_on_start":{
"value": false,
"config_file": true,
"config_web": true
}
}, },
"epg":{ "epg":{
"images":{ "images":{

View File

@ -1,4 +1,5 @@
import datetime import datetime
import time
from fHDHR.tools import hours_between_datetime from fHDHR.tools import hours_between_datetime
@ -19,7 +20,9 @@ class Channels():
self.list_update_time = None self.list_update_time = None
self.get_db_channels() self.get_db_channels()
self.get_channels() haseverscanned = self.fhdhr.db.get_fhdhr_value("channels", "scanned_time")
if (self.fhdhr.config.dict["fhdhr"]["chanscan_on_start"] or not haseverscanned):
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) return next(self.list[fhdhr_id] for fhdhr_id in list(self.list.keys()) if self.list[fhdhr_id].dict[keyfind] == valfind)
@ -68,6 +71,7 @@ class Channels():
if not self.list_update_time: if not self.list_update_time:
self.fhdhr.logger.info("Found " + str(len(self.list)) + " channels for " + str(self.fhdhr.config.dict["main"]["servicename"])) self.fhdhr.logger.info("Found " + str(len(self.list)) + " channels for " + str(self.fhdhr.config.dict["main"]["servicename"]))
self.list_update_time = datetime.datetime.now() self.list_update_time = datetime.datetime.now()
self.fhdhr.db.set_fhdhr_value("channels", "scanned_time", time.time())
channel_list = [] channel_list = []
for chan_obj in list(self.list.keys()): for chan_obj in list(self.list.keys()):