Fix cancelling non-started downloads (#383)
This commit is contained in:
parent
feec0c56b4
commit
9e9112f7ef
|
|
@ -329,6 +329,10 @@ class DownloadQueue:
|
||||||
|
|
||||||
async def cancel(self, ids):
|
async def cancel(self, ids):
|
||||||
for id in ids:
|
for id in ids:
|
||||||
|
if self.pending.exists(id):
|
||||||
|
self.pending.delete(id)
|
||||||
|
await self.notifier.canceled(id)
|
||||||
|
continue
|
||||||
if not self.queue.exists(id):
|
if not self.queue.exists(id):
|
||||||
log.warn(f'requested cancel for non-existent download {id}')
|
log.warn(f'requested cancel for non-existent download {id}')
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue