Add req and res to allow download filter hooks

This commit is contained in:
Chocobozzz 2022-12-06 13:50:18 +01:00
parent bd09dfaf8d
commit b6640fa0af
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 19 additions and 3 deletions

View File

@ -50,7 +50,12 @@ async function downloadTorrent (req: express.Request, res: express.Response) {
}) })
} }
const allowParameters = { torrentPath: result.path, downloadName: result.downloadName } const allowParameters = {
req,
res,
torrentPath: result.path,
downloadName: result.downloadName
}
const allowedResult = await Hooks.wrapFun( const allowedResult = await Hooks.wrapFun(
isTorrentDownloadAllowed, isTorrentDownloadAllowed,
@ -74,7 +79,12 @@ async function downloadVideoFile (req: express.Request, res: express.Response) {
}) })
} }
const allowParameters = { video, videoFile } const allowParameters = {
req,
res,
video,
videoFile
}
const allowedResult = await Hooks.wrapFun( const allowedResult = await Hooks.wrapFun(
isVideoDownloadAllowed, isVideoDownloadAllowed,
@ -110,7 +120,13 @@ async function downloadHLSVideoFile (req: express.Request, res: express.Response
}) })
} }
const allowParameters = { video, streamingPlaylist, videoFile } const allowParameters = {
req,
res,
video,
streamingPlaylist,
videoFile
}
const allowedResult = await Hooks.wrapFun( const allowedResult = await Hooks.wrapFun(
isVideoDownloadAllowed, isVideoDownloadAllowed,