fix createPage in WTVAuthor

This commit is contained in:
zefie
2025-08-13 15:00:31 -04:00
parent cd611e286e
commit 25fff4b3a7
3 changed files with 10 additions and 8 deletions

View File

@@ -97,7 +97,7 @@ data = `<html>
<br><br> <br><br>
<font color=white> <font color=white>
<progressindicator name="downloadprogress" <progressindicator name="downloadprogress"
message="Retrieving Files..." message="${message}"
height=40 width=250> height=40 width=250>
</font> </font>
</table> </table>

View File

@@ -3,6 +3,7 @@ const minisrv_service_file = true;
if (request_headers['wtv-request-type'] === "download") { if (request_headers['wtv-request-type'] === "download") {
const wtvdl = new WTVDisk(minisrv_config, service_name); const wtvdl = new WTVDisk(minisrv_config, service_name);
headers = "200 OK\nContent-Type: " + wtvdl.content_type; headers = "200 OK\nContent-Type: " + wtvdl.content_type;
wtvdl.display("Obtaining group data...");
wtvdl.execute('client:donothing'); wtvdl.execute('client:donothing');
data = wtvdl.getDownloadList(); data = wtvdl.getDownloadList();
const client_group_data = wtvdl.getGroupDataFromClientPost(request_headers.post_data.toString(CryptoJS.enc.Latin1)); const client_group_data = wtvdl.getGroupDataFromClientPost(request_headers.post_data.toString(CryptoJS.enc.Latin1));
@@ -13,8 +14,9 @@ if (request_headers['wtv-request-type'] === "download") {
const query = request_headers.query; const query = request_headers.query;
query['url'] = 'wtv-disk:/get-group-data'; query['url'] = 'wtv-disk:/get-group-data';
query['success_url'] = 'wtv-disk:/delete-group'; query['success_url'] = 'wtv-disk:/delete-group';
query['message'] = "Obtaining group data...";
const queryString = Object.keys(query) const queryString = Object.keys(query)
.map(key => encodeURIComponent(key) + '=' + encodeURIComponent(query[key])) .map(key => encodeURIComponent(key) + '=' + encodeURIComponent(query[key]))
.join('&'); .join('&');
headers = "302 Found\nLocation: wtv-disk:/content/DownloadScreen.tmpl" + (queryString ? ("?" + queryString) : ""); headers = "302 Found\nwtv-expire-all:wtv-disk:\nLocation: wtv-disk:/content/DownloadScreen.tmpl" + (queryString ? ("?" + queryString) : "");
} }

View File

@@ -98,7 +98,7 @@ class WTVAuthor {
} }
pagenums = pagenums.sort() pagenums = pagenums.sort()
this.debug("createPage", "pagenums", pagenums) this.debug("createPage", "pagenums", pagenums)
const pagenum = parseInt(pagenums[pagelen - 1]); pagenum = parseInt(pagenums[pagelen - 1]);
this.debug("createPage", "pagenum", pagenum) this.debug("createPage", "pagenum", pagenum)
this.debug("createPage", "pagelen", pagelen) this.debug("createPage", "pagelen", pagelen)
} }
@@ -139,12 +139,12 @@ class WTVAuthor {
loadPage(pagenum) { loadPage(pagenum) {
this.pagestoreExists() this.pagestoreExists()
const page_file = this.listPages(); const page_file = this.listPages();
const page_data_raw = page_file[pagenum]; const page_data_raw = page_file[pagenum];
if (page_data_raw) { if (page_data_raw) {
return page_data_raw; return page_data_raw;
} }
return false; return false;
} }