forked from Tomas/webdl
Don't redownload urls
This commit is contained in:
@ -38,6 +38,14 @@ app.get("/download/:filename", (req,res)=>{
|
|||||||
parts.shift();
|
parts.shift();
|
||||||
const url = parts.join("?");
|
const url = parts.join("?");
|
||||||
|
|
||||||
|
for (const dl of Object.entries(dlmgr.getDownloads()))
|
||||||
|
if (dl[1].url == url)
|
||||||
|
return res.status(303).header("Location", "/#"+dl[0]).send(dl[0]);
|
||||||
|
|
||||||
|
for (const dl of Object.entries(dlmgr.getQueue()))
|
||||||
|
if (dl[1].url == url)
|
||||||
|
return res.status(303).header("Location", "/#"+dl[0]).send(dl[0]);
|
||||||
|
|
||||||
const id = dlmgr.download(url, filename);
|
const id = dlmgr.download(url, filename);
|
||||||
|
|
||||||
return res.status(303).header("Location", "/#"+id).send(id);
|
return res.status(303).header("Location", "/#"+id).send(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user