[addon] add named queue to run single unrestrict

This commit is contained in:
TheBeastLT
2020-03-18 11:14:43 +01:00
parent b08d46efd4
commit 9c066a88f1
3 changed files with 15 additions and 10 deletions

View File

@@ -71,10 +71,10 @@ router.get('/:configuration/:resource/:type/:id.json', (req, res, next) => {
router.get('/realdebrid/:apiKey/:infoHash/:cachedFileIds/:fileIndex?', (req, res) => {
const { apiKey, infoHash, cachedFileIds, fileIndex } = req.params;
console.time(infoHash);
console.log(`Unrestricting ${infoHash} [${fileIndex}]`);
realDebrid.unrestrict(apiKey, infoHash, cachedFileIds, isNaN(fileIndex) ? undefined : parseInt(fileIndex))
.then(url => {
console.timeEnd(infoHash);
console.log(`Unrestricted ${infoHash} [${fileIndex}] to ${url}`);
res.writeHead(301, { Location: url });
res.end();
})