diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/content/DownloadScreen.tmpl.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/content/DownloadScreen.tmpl.js index 7a772b5f..98f2b633 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/content/DownloadScreen.tmpl.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/content/DownloadScreen.tmpl.js @@ -46,8 +46,9 @@ data = ` http-equiv=refresh content="0;url=client:Fetch?source=wtv-disk:/sync`; if (request_headers.query.diskmap) data += `%3fdiskmap%3d${request_headers.query.diskmap}`; +if (request_headers.query.force) data += `%26force%3dtrue` if (!request_headers.query.group) data += `&root=file://Disk/Browser/`; -else data += `&group=${request_headers.query.group}`; +else data += `&group=${request_headers.query.group}`;; data += `&message=Retrieving Files..." > @@ -77,7 +78,7 @@ data += `&message=Retrieving Files..." - Your ${wtvshared.getBoxName(session_data.get("wtv-client-rom-type"))} is retrieving some files. + Your ${session_data.getBoxName()} is retrieving some files.

This usually takes a while. diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/sync.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/sync.js index e638fd5f..60b25c48 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/sync.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/sync.js @@ -65,7 +65,11 @@ if (request_headers['wtv-request-type'] == 'download') { if (update_list[k].checksum_match && !force_update) return; if (!update_list[k].invalid && !force_update) return; } - wtvdl.delete(update_list[k].file.replace(diskmap_group_data.base, ""), diskmap_group_name); + delete_file = update_list[k].file.replace(diskmap_group_data.base, "") + if (!diskmap_group_data.files[k].dont_extract_filename) { + delete_file = delete_file.replace(".gz",""); + } + wtvdl.delete(delete_file, diskmap_group_name); }); Object.keys(update_list).forEach(function (k) { @@ -228,11 +232,12 @@ if (request_headers['wtv-request-type'] == 'download') { // we need the checksum of the uncompressed data if (wtvshared.getFileExt(diskmap_data_file).toLowerCase() == "gz") { + var diskmap_data_filename = path.basename(diskmap_data_file); var gunzipped = zlib.gunzipSync(diskmap_file_data); diskmap_group_data.files[k].checksum = CryptoJS.MD5(CryptoJS.lib.WordArray.create(gunzipped)).toString(CryptoJS.enc.Hex).toLowerCase(); var gzip_fn_end = diskmap_file_data.indexOf("\0", 10); if (!diskmap_group_data.files[k].dont_extract_filename) { - diskmap_group_data.files[k].original_filename = diskmap_file_data.toString('utf8', 10, gzip_fn_end); + diskmap_group_data.files[k].original_filename = diskmap_group_data.files[k].file.replace(diskmap_group_data.base,"").replace(diskmap_data_filename, diskmap_file_data.toString('utf8', 10, gzip_fn_end)); } diskmap_group_data.files[k].uncompressed_size = gunzipped.byteLength; gunzipped = null; diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/lc2-download-complete.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/lc2-download-complete.js index 13a6236e..98520248 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/lc2-download-complete.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/lc2-download-complete.js @@ -2,6 +2,7 @@ var minisrv_service_file = true; headers = `200 OK Content-type: text/html +wtv-expire-all: wtv-flashrom: minisrv-no-mail-count: true` if (socket.ssid && ssid_sessions[socket.ssid]) { diff --git a/zefie_wtvp_minisrv/includes/classes/WTVDisk.js b/zefie_wtvp_minisrv/includes/classes/WTVDisk.js index 95b99ea2..04286738 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVDisk.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVDisk.js @@ -150,14 +150,9 @@ class WTVDownloadList { */ get(file, path, source, group, checksum = null, uncompressed_size = null, original_filename = null, file_permission = 'r') { if (original_filename) { - file = file.split('/'); - const file_name = file[file.length - 1]; - path = path.replace(file_name, original_filename); - file.pop(); - if (file.length > 0) file = file.join('/') + '/' + original_filename; - else file = original_filename; + path = path.replace(file, original_filename); } - this.download_list += `GET ${file}\n`; + this.download_list += `GET ${original_filename || file}\n`; source = source.replace(/\\/g, "/"); this.download_list += `group: ${group}-UPDATE\n`; diff --git a/zefie_wtvp_minisrv/includes/classes/WTVShared.js b/zefie_wtvp_minisrv/includes/classes/WTVShared.js index cfcae873..277bae19 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVShared.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVShared.js @@ -176,34 +176,6 @@ class WTVShared { return out; } - /** - * Gets the box name based on the client ROM type - * @param {string} client_rom_type The client ROM type - * @returns {string} The box name - */ - getBoxName(client_rom_type) { - switch (client_rom_type) { - case "bf0app": - case "bfeapp": - case "US-BPS-flashdisk-0MB-8MB-softmodem-CPU5230": - case "US-BPS-flashdisk-0MB-16MB-softmodem-CPU5230": - return "WebTV Internet Terminal"; - - case "US-DTV-disk-0MB-32MB-softmodem-CPU5230": - case "US-WEBSTAR-disk-0MB-8MB-softmodem-CPU5230": - case "US-WEBSTAR-disk-0MB-16MB-softmodem-CPU5230": - return "WebTV Satellite Receiver"; - - case "US-LC2-disk-0MB-8MB": - case "US-LC2-disk-0MB-8MB-softmodem-CPU5230": - case "US-LC2-flashdisk-0MB-16MB-softmodem-CPU5230": - return "WebTV Plus Internet Receiver"; - - default: - return "WebTV Internet Receiver"; - } - } - /** * Calculates the CRC of an SSID, WNI Style * @param {string} ssid