Commit c0f0a631 authored by mercury233's avatar mercury233

fix Gid not exists

parent 3c1899e9
......@@ -153,7 +153,9 @@ export class DownloadService {
gids!.map((value, index, array) => {
let s = this.downloadList.get(value);
if (!s) {
throw 'Gid not exists';
// in refreshDownloadList, a job may disappear between tellActive and tellWaiting
console.warn('Gid not exists ' + value);
return new DownloadStatus();
}
return s;
})
......@@ -207,14 +209,6 @@ export class DownloadService {
return taskId;
}
async addUri (url: string, destination: string): Promise<string> {
await this.open;
let taskId = this.createId();
let gid = await this.aria2.addUri([url], {dir: destination});
this.taskMap.set(taskId, [gid]);
return taskId;
}
async pause (id: string): Promise<void> {
await this.open;
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment