diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js b/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js index d47306c4..378c1944 100644 --- a/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js +++ b/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js @@ -181,8 +181,6 @@ data = ` `; -// unreleased for now -if (fs.existsSync(__dirname + "/WTVGuide.js")) { data += ` @@ -194,7 +192,7 @@ if (fs.existsSync(__dirname + "/WTVGuide.js")) { - +
- diff --git a/zefie_wtvp_minisrv/WTVGuide.js b/zefie_wtvp_minisrv/WTVGuide.js index b29439a7..dcb797ab 100644 --- a/zefie_wtvp_minisrv/WTVGuide.js +++ b/zefie_wtvp_minisrv/WTVGuide.js @@ -37,8 +37,8 @@ class WTVGuide { switch (topic.toLowerCase()) { case "glossary": - var template = ServiceDeps+ "/wtv-guide/templates/glossary.js"; - var glossary_datafile = ServiceDeps+ "/wtv-guide/glossary.json"; + var template = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + "/wtv-guide/templates/glossary.js"); + var glossary_datafile = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + "/wtv-guide/glossary.json"); if (!this.fs.existsSync(template)) break; if (!this.fs.existsSync(glossary_datafile)) break; @@ -123,7 +123,7 @@ class WTVGuide { } } else { // glossary letter word index - var template = ServiceDeps+ "/wtv-guide/templates/glossary_word_index.js"; + var template = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + "/wtv-guide/templates/glossary_word_index.js"); var isPlusBox = false; if (this.session_data.hasCap("client-has-tv-experience")) isPlusBox = true; var worddb = []; @@ -146,8 +146,9 @@ class WTVGuide { case "index": switch (subtopic.toLowerCase()) { case "glossary": - var template = ServiceDeps+ "/wtv-guide/templates/glossary_index.js"; - var glossary_datafile = ServiceDeps+ "/wtv-guide/glossary.json"; + var template = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + "/wtv-guide/templates/glossary_index.js"); + console.log(template); + var glossary_datafile = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + "/wtv-guide/glossary.json"); if (!this.fs.existsSync(template)) break; if (!this.fs.existsSync(glossary_datafile)) break; @@ -166,9 +167,9 @@ class WTVGuide { // fallback to old js file method try { var prerendered = null; - if (!page) prerendered = ServiceDeps+ "/wtv-guide/prerendered/" + topic + "/" + subtopic + ".js"; - else prerendered = ServiceDeps+ "/wtv-guide/prerendered/" + topic + "/" + subtopic + "/" + page + ".js"; - console.log(prerendered) + if (!page) prerendered = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + "/wtv-guide/prerendered/" + topic + "/" + subtopic + ".js"); + else prerendered = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + "/wtv-guide/prerendered/" + topic + "/" + subtopic + "/" + page + ".js"); + if (!this.fs.existsSync(prerendered)) break; diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 7ff7637f..26c13a19 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -107,8 +107,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa // The ServiceVault scripts will only be allowed to access the following fcnutions/variables. // Furthermore, only modifications to variables in `updateFromVM` will be saved. // Example: an attempt to change "minisrv_config" from a ServiceVault script would be discarded - var WTVGuide = null; - if (fs.existsSync(__dirname + "/WTVGuide.js")) WTVGuide = require("./WTVGuide.js"); + var WTVGuide = require("./WTVGuide.js"); var WTVBGMusic = require("./WTVBGMusic.js"); var WTVDownloadList = require("./WTVDownloadList.js");
@@ -222,16 +220,6 @@ if (fs.existsSync(__dirname + "/WTVGuide.js")) {
-`; -} else { - data += ` -
-`; -} - -data += ` -