diff --git a/fHDHR/config/__init__.py b/fHDHR/config/__init__.py index 1921cf7..3891d66 100644 --- a/fHDHR/config/__init__.py +++ b/fHDHR/config/__init__.py @@ -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, diff --git a/fHDHR/device/cluster.py b/fHDHR/device/cluster.py index 4d5a5ab..c9e7dfc 100644 --- a/fHDHR/device/cluster.py +++ b/fHDHR/device/cluster.py @@ -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) diff --git a/fHDHR_web/__init__.py b/fHDHR_web/__init__.py index 7b01fdb..4371ba1 100644 --- a/fHDHR_web/__init__.py +++ b/fHDHR_web/__init__.py @@ -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, diff --git a/fHDHR_web/api/__init__.py b/fHDHR_web/api/__init__.py index 1fc4ff0..359f9a6 100644 --- a/fHDHR_web/api/__init__.py +++ b/fHDHR_web/api/__init__.py @@ -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) diff --git a/fHDHR_web/pages/__init__.py b/fHDHR_web/pages/__init__.py index f2a7d14..f0c4acd 100644 --- a/fHDHR_web/pages/__init__.py +++ b/fHDHR_web/pages/__init__.py @@ -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) diff --git a/origin/__init__.py b/origin/__init__.py index 5918619..6014624 100644 --- a/origin/__init__.py +++ b/origin/__init__.py @@ -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" diff --git a/origin/origin_web/__init__.py b/origin/origin_web/__init__.py new file mode 100644 index 0000000..4b6008e --- /dev/null +++ b/origin/origin_web/__init__.py @@ -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) diff --git a/origin/origin.html b/origin/origin_web/origin.html similarity index 100% rename from origin/origin.html rename to origin/origin_web/origin.html diff --git a/origin/origin_api.py b/origin/origin_web/origin_api.py similarity index 100% rename from origin/origin_api.py rename to origin/origin_web/origin_api.py diff --git a/origin/origin_html.py b/origin/origin_web/origin_html.py similarity index 100% rename from origin/origin_html.py rename to origin/origin_web/origin_html.py