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>
<font color=white>
<progressindicator name="downloadprogress"
message="Retrieving Files..."
message="${message}"
height=40 width=250>
</font>
</table>

View File

@@ -3,6 +3,7 @@ const minisrv_service_file = true;
if (request_headers['wtv-request-type'] === "download") {
const wtvdl = new WTVDisk(minisrv_config, service_name);
headers = "200 OK\nContent-Type: " + wtvdl.content_type;
wtvdl.display("Obtaining group data...");
wtvdl.execute('client:donothing');
data = wtvdl.getDownloadList();
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;
query['url'] = 'wtv-disk:/get-group-data';
query['success_url'] = 'wtv-disk:/delete-group';
query['message'] = "Obtaining group data...";
const queryString = Object.keys(query)
.map(key => encodeURIComponent(key) + '=' + encodeURIComponent(query[key]))
.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()
this.debug("createPage", "pagenums", pagenums)
const pagenum = parseInt(pagenums[pagelen - 1]);
pagenum = parseInt(pagenums[pagelen - 1]);
this.debug("createPage", "pagenum", pagenum)
this.debug("createPage", "pagelen", pagelen)
}
@@ -139,12 +139,12 @@ class WTVAuthor {
loadPage(pagenum) {
this.pagestoreExists()
const page_file = this.listPages();
const page_data_raw = page_file[pagenum];
const page_file = this.listPages();
const page_data_raw = page_file[pagenum];
if (page_data_raw) {
return page_data_raw;
}
if (page_data_raw) {
return page_data_raw;
}
return false;
}