Do not abuse serverName to store browserName
This commit is contained in:
parent
dabf7f8a28
commit
42ccfd5dc5
@ -27,6 +27,7 @@ const SAVEDPROPS = [
|
|||||||
"written",
|
"written",
|
||||||
// server stuff
|
// server stuff
|
||||||
"serverName",
|
"serverName",
|
||||||
|
"browserName",
|
||||||
"mime",
|
"mime",
|
||||||
"prerolled",
|
"prerolled",
|
||||||
// other options
|
// other options
|
||||||
@ -41,6 +42,7 @@ const DEFAULTS = {
|
|||||||
state: QUEUED,
|
state: QUEUED,
|
||||||
error: "",
|
error: "",
|
||||||
serverName: "",
|
serverName: "",
|
||||||
|
browserName: "",
|
||||||
fileName: "",
|
fileName: "",
|
||||||
totalSize: 0,
|
totalSize: 0,
|
||||||
written: 0,
|
written: 0,
|
||||||
@ -95,6 +97,8 @@ export class BaseDownload {
|
|||||||
|
|
||||||
public serverName: string;
|
public serverName: string;
|
||||||
|
|
||||||
|
public browserName: string;
|
||||||
|
|
||||||
public mime: string;
|
public mime: string;
|
||||||
|
|
||||||
public mask: string;
|
public mask: string;
|
||||||
@ -135,7 +139,7 @@ export class BaseDownload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get currentName() {
|
get currentName() {
|
||||||
return this.serverName || this.dest.name || this.finalName;
|
return this.browserName || this.dest.name || this.finalName;
|
||||||
}
|
}
|
||||||
|
|
||||||
get urlName() {
|
get urlName() {
|
||||||
@ -175,7 +179,7 @@ export class BaseDownload {
|
|||||||
rv.destName = dest.name;
|
rv.destName = dest.name;
|
||||||
rv.destPath = dest.path;
|
rv.destPath = dest.path;
|
||||||
rv.destFull = dest.full;
|
rv.destFull = dest.full;
|
||||||
rv.currentName = this.serverName || rv.destName || rv.finalName;
|
rv.currentName = this.browserName || rv.destName || rv.finalName;
|
||||||
rv.error = this.error;
|
rv.error = this.error;
|
||||||
rv.ext = this.renamer.p_ext;
|
rv.ext = this.renamer.p_ext;
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -374,7 +374,7 @@ export class Download extends BaseDownload {
|
|||||||
this.prerolled = false;
|
this.prerolled = false;
|
||||||
this.manId = 0;
|
this.manId = 0;
|
||||||
this.written = this.totalSize = 0;
|
this.written = this.totalSize = 0;
|
||||||
this.mime = this.serverName = "";
|
this.mime = this.serverName = this.browserName = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeFromBrowser() {
|
async removeFromBrowser() {
|
||||||
@ -451,7 +451,7 @@ export class Download extends BaseDownload {
|
|||||||
const state = (await downloads.search({id: this.manId})).pop();
|
const state = (await downloads.search({id: this.manId})).pop();
|
||||||
const {filename, error} = state;
|
const {filename, error} = state;
|
||||||
const path = parsePath(filename);
|
const path = parsePath(filename);
|
||||||
this.serverName = path.name;
|
this.browserName = path.name;
|
||||||
this.adoptSize(state);
|
this.adoptSize(state);
|
||||||
if (!this.mime && state.mime) {
|
if (!this.mime && state.mime) {
|
||||||
this.mime = state.mime;
|
this.mime = state.mime;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user