This commit is contained in:
deathbybandaid 2020-12-10 08:33:16 -05:00
parent e938a9c1a2
commit a0103b7a32
10 changed files with 23 additions and 10 deletions

View File

@ -32,12 +32,14 @@ class Config():
data_dir = pathlib.Path(script_dir).joinpath('data')
fHDHR_web_dir = pathlib.Path(script_dir).joinpath('fHDHR_web')
www_dir = pathlib.Path(fHDHR_web_dir).joinpath('www_dir')
origin_dir = pathlib.Path(script_dir).joinpath('origin')
self.internal["paths"] = {
"script_dir": script_dir,
"data_dir": data_dir,
"alternative_epg": pathlib.Path(script_dir).joinpath('alternative_epg'),
"origin": pathlib.Path(script_dir).joinpath('origin'),
"origin": origin_dir,
"origin_web": pathlib.Path(origin_dir).joinpath('origin_web'),
"cache_dir": pathlib.Path(data_dir).joinpath('cache'),
"internal_config": pathlib.Path(data_dir).joinpath('internal_config'),
"www_dir": www_dir,

View File

@ -67,7 +67,7 @@ class fHDHR_Cluster():
self.fhdhr.logger.info("Found %s clustered services." % str(len(list(cluster.keys()))))
for location in list(cluster.keys()):
if location != self.fhdhr.api.base:
self.fhdhr.logger.info("Checking Cluster Syncronization information from %s." % location)
self.fhdhr.logger.debug("Checking Cluster Syncronization information from %s." % location)
sync_url = location + "/api/cluster?method=get"
try:
sync_open = self.fhdhr.web.session.get(sync_url)

View File

@ -43,6 +43,10 @@ class fHDHR_HTTP_Server():
self.api = fHDHR_API(fhdhr)
self.add_endpoints(self.api, "api")
self.fhdhr.logger.info("Loading HTTP Origin Endpoints.")
self.origin_endpoints = self.fhdhr.originwrapper.origin.origin_web.fHDHR_Origin_Web(fhdhr)
self.add_endpoints(self.origin_endpoints, "origin_endpoints")
self.app.before_request(self.before_request)
self.app.after_request(self.after_request)
self.app.before_first_request(self.before_first_request)
@ -69,7 +73,7 @@ class fHDHR_HTTP_Server():
endpoint_methods = eval("self." + str(index_name) + "." + str(item) + ".endpoint_methods")
except AttributeError:
endpoint_methods = ['GET']
self.fhdhr.logger.info("Adding endpoint %s available at %s with %s methods." % (endpoint_name, ",".join(endpoints), ",".join(endpoint_methods)))
self.fhdhr.logger.debug("Adding endpoint %s available at %s with %s methods." % (endpoint_name, ",".join(endpoints), ",".join(endpoint_methods)))
for endpoint in endpoints:
self.add_endpoint(endpoint=endpoint,
endpoint_name=endpoint_name,

View File

@ -30,5 +30,3 @@ class fHDHR_API():
self.debug = Debug_JSON(fhdhr)
self.images = Images(fhdhr)
self.origin_api = self.fhdhr.originwrapper.origin.Origin_API(fhdhr)

View File

@ -27,5 +27,3 @@ class fHDHR_Pages():
self.version_html = Version_HTML(fhdhr)
self.diagnostics_html = Diagnostics_HTML(fhdhr)
self.settings_html = Settings_HTML(fhdhr)
self.origin_html = self.fhdhr.originwrapper.origin.Origin_HTML(fhdhr)

View File

@ -2,8 +2,7 @@
from .origin_service import *
from .origin_channels import *
from .origin_epg import *
from .origin_html import *
from .origin_api import *
from .origin_web import *
ORIGIN_NAME = "fHDHR_IPTVorg"
ORIGIN_NAME = "fHDHR_Locast"
ORIGIN_VERSION = "v0.5.0-beta"

View File

@ -0,0 +1,12 @@
from .origin_api import Origin_API
from .origin_html import Origin_HTML
class fHDHR_Origin_Web():
def __init__(self, fhdhr):
self.fhdhr = fhdhr
self.origin_api = Origin_API(fhdhr)
self.origin_html = Origin_HTML(fhdhr)