From b6640fa0af863ae99fc33297bf59744bcd8fb2b8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Dec 2022 13:50:18 +0100 Subject: [PATCH] Add req and res to allow download filter hooks --- server/controllers/download.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/server/controllers/download.ts b/server/controllers/download.ts index 65b9a1d1b..d675a2d6c 100644 --- a/server/controllers/download.ts +++ b/server/controllers/download.ts @@ -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( 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( 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( isVideoDownloadAllowed,