From 1143b158da5ff3e8ca50ab87dbee0ee7d8ff0838 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Tue, 15 Dec 2020 11:27:41 -0500 Subject: [PATCH] Add Channel Import Logging --- fHDHR/device/channels/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fHDHR/device/channels/__init__.py b/fHDHR/device/channels/__init__.py index 9d8cf01..fa2a658 100644 --- a/fHDHR/device/channels/__init__.py +++ b/fHDHR/device/channels/__init__.py @@ -1,7 +1,7 @@ import datetime import time -from fHDHR.tools import hours_between_datetime +from fHDHR.tools import hours_between_datetime, humanized_time from .channel import Channel from .chan_ident import Channel_IDs @@ -83,7 +83,10 @@ class Channels(): channel_dict_list = self.origin.get_channels() self.fhdhr.logger.info("Found %s channels for %s." % (len(channel_dict_list), self.fhdhr.config.dict["main"]["servicename"])) + self.fhdhr.logger.info("Performing Channel Import, This can take some time, Please wait.") + newchan = 0 + chan_scan_start = time.time() for channel_info in channel_dict_list: chan_existing = False @@ -99,6 +102,8 @@ class Channels(): self.list[channel_id] = channel_obj newchan += 1 + self.fhdhr.logger.info("Channel Import took %s" % humanized_time(time.time() - chan_scan_start)) + if not newchan: newchan = "no" self.fhdhr.logger.info("Found %s NEW channels." % newchan)