test
This commit is contained in:
parent
93b9f03792
commit
ab0c55bd4c
@ -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():
|
class Watch_HTML():
|
||||||
@ -11,6 +13,10 @@ class Watch_HTML():
|
|||||||
def __init__(self, fhdhr, plugin_utils):
|
def __init__(self, fhdhr, plugin_utils):
|
||||||
self.fhdhr = fhdhr
|
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):
|
def __call__(self, *args):
|
||||||
return self.get(*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)
|
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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user