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

Merge pull request #88 from deathbybandaid/dev

Dev
This commit is contained in:
Deathbybandaid 2020-12-15 11:50:05 -05:00 committed by GitHub
commit baf4cf461c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View File

@ -1,7 +1,7 @@
{ {
"logging":{ "logging":{
"level":{ "level":{
"value": "WARNING", "value": "INFO",
"config_file": true, "config_file": true,
"config_web": true "config_web": true
} }

View File

@ -1,7 +1,7 @@
import datetime import datetime
import time import time
from fHDHR.tools import hours_between_datetime from fHDHR.tools import hours_between_datetime, humanized_time
from .channel import Channel from .channel import Channel
from .chan_ident import Channel_IDs from .chan_ident import Channel_IDs
@ -83,7 +83,10 @@ class Channels():
channel_dict_list = self.origin.get_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("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 newchan = 0
chan_scan_start = time.time()
for channel_info in channel_dict_list: for channel_info in channel_dict_list:
chan_existing = False chan_existing = False
@ -99,6 +102,8 @@ class Channels():
self.list[channel_id] = channel_obj self.list[channel_id] = channel_obj
newchan += 1 newchan += 1
self.fhdhr.logger.info("Channel Import took %s" % humanized_time(time.time() - chan_scan_start))
if not newchan: if not newchan:
newchan = "no" newchan = "no"
self.fhdhr.logger.info("Found %s NEW channels." % newchan) self.fhdhr.logger.info("Found %s NEW channels." % newchan)

View File

@ -95,12 +95,17 @@ class Tuners():
if not stream_args["channelUri"]: if not stream_args["channelUri"]:
raise TunerError("806 - Tune Failed") raise TunerError("806 - Tune Failed")
channelUri_headers = self.fhdhr.web.session.head(stream_args["channelUri"]).headers if stream_args["channelUri"].startswith("udp://"):
stream_args["true_content_type"] = channelUri_headers['Content-Type'] stream_args["true_content_type"] = "video/mpeg"
if stream_args["true_content_type"].startswith(tuple(["application/", "text/"])):
stream_args["content_type"] = "video/mpeg" stream_args["content_type"] = "video/mpeg"
else: else:
stream_args["content_type"] = stream_args["true_content_type"]
channelUri_headers = self.fhdhr.web.session.head(stream_args["channelUri"]).headers
stream_args["true_content_type"] = channelUri_headers['Content-Type']
if stream_args["true_content_type"].startswith(tuple(["application/", "text/"])):
stream_args["content_type"] = "video/mpeg"
else:
stream_args["content_type"] = stream_args["true_content_type"]
return stream_args return stream_args