lots more stuff

- proper gzip download for disk system (aka WNI reinventing the Content-Encoding: gzip wheel)
- send Last-Modified for static files
- send wtv-checksum for all disk system downloads
- other fixes
This commit is contained in:
zefie
2021-08-11 00:56:21 -04:00
parent 11935a5886
commit 95442a12af
21 changed files with 185 additions and 100 deletions

View File

@@ -104,6 +104,7 @@ class WTVDownloadList {
* @param {string} group Group to which it belongs
*/
delete(path, group = null) {
path = this.wtvshared.stripGzipFromPath(path);
this.download_list += "DELETE " + path + "\n";
if (group !== null) this.download_list += "group: " + group + "\n\n";
}
@@ -145,13 +146,16 @@ class WTVDownloadList {
* @param {string} checksum md5sum of the file
* @param {string} file_permission File permissions
*/
get(file, path, source, group, checksum = null, file_permission = 'r') {
get(file, path, source, group, checksum = null, uncompressed_size = null, file_permission = 'r') {
file = this.wtvshared.stripGzipFromPath(file);
this.download_list += "GET " + file + "\n";
this.download_list += "group: " + group + "-UPDATE\n";
this.download_list += "location: " + source + "\n";
this.download_list += "file-permission: " + file_permission + "\n";
if (checksum != null) this.download_list += "wtv-checksum: " + checksum + "\n";
if (uncompressed_size != null) this.download_list += "wtv-uncompressed-filesize: " + uncompressed_size + "\n";
this.download_list += "service-source-location: /webtv/content/" + source.substr(source.indexOf('-') + 1, source.indexOf(':/') - source.indexOf('-') - 1) + "d/" + source.substr(source.indexOf(':/') + 2) + "\n";
path = this.wtvshared.stripGzipFromPath(path);
this.download_list += "client-dest-location: " + path + "\n\n";
}
@@ -163,6 +167,8 @@ class WTVDownloadList {
* @param {string} destgroup Destination Group
*/
rename(srcfile, destfile, srcgroup, destgroup) {
srcfile = this.wtvshared.stripGzipFromPath(srcfile);
destfile = this.wtvshared.stripGzipFromPath(destfile);
this.download_list += "RENAME " + srcfile + "\n";
this.download_list += "group: " + srcgroup + "-UPDATE\n";
this.download_list += "destination-group: " + destgroup + "\n";