From ab0c55bd4c7d0a59656006f29dff0ed26ea4c484 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 4 Feb 2021 09:24:11 -0500 Subject: [PATCH] test --- web/webwatch_html.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/webwatch_html.py b/web/webwatch_html.py index cb0cfa2..05012c0 100644 --- a/web/webwatch_html.py +++ b/web/webwatch_html.py @@ -1,4 +1,6 @@ -from flask import request, render_template, session +from flask import request, render_template_string, session +import pathlib +from io import StringIO class Watch_HTML(): @@ -11,6 +13,10 @@ class Watch_HTML(): def __init__(self, fhdhr, plugin_utils): self.fhdhr = fhdhr + self.template_file = pathlib.Path(plugin_utils.config.dict["plugin_web_paths"][plugin_utils.namespace]["path"]).joinpath('webwatch.html') + self.template = StringIO() + self.template.write(open(self.template_file).read()) + def __call__(self, *args): return self.get(*args) @@ -23,4 +29,4 @@ class Watch_HTML(): watch_url = '%s/api/tuners?method=stream&channel=%s&origin=%s&stream_method=webwatch' % (base_url, channel_id, origin) - return render_template('webwatch.html', request=request, session=session, fhdhr=self.fhdhr, watch_url=watch_url) + return render_template_string(self.template.getvalue(), request=request, session=session, fhdhr=self.fhdhr, watch_url=watch_url)