From 3601872153ee06a2b58b7fb45898e2b7acbb62ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 3 Oct 2023 09:36:00 +0200 Subject: [PATCH] Support empty value returned by video get filter --- packages/tests/src/api/videos/video-source.ts | 2 +- server/server/controllers/api/videos/index.ts | 2 ++ server/server/lib/job-queue/handlers/video-live-ending.ts | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/tests/src/api/videos/video-source.ts b/packages/tests/src/api/videos/video-source.ts index efe8c3802..cbde5c4b2 100644 --- a/packages/tests/src/api/videos/video-source.ts +++ b/packages/tests/src/api/videos/video-source.ts @@ -317,7 +317,7 @@ describe('Test a video file replacement', function () { }) it('Should not auto blacklist if auto blacklist has been disabled between the upload and the replacement', async function () { - this.timeout(120000) + this.timeout(240000) const { uuid } = await servers[0].videos.quickUpload({ token: userToken, name: 'user video' }) await waitJobs(servers) diff --git a/server/server/controllers/api/videos/index.ts b/server/server/controllers/api/videos/index.ts index 508cbb7c5..430555ac4 100644 --- a/server/server/controllers/api/videos/index.ts +++ b/server/server/controllers/api/videos/index.ts @@ -155,6 +155,8 @@ async function getVideo (_req: express.Request, res: express.Response) { const userId = res.locals.oauth?.token.User.id const video = await Hooks.wrapObject(res.locals.videoAPI, 'filter:api.video.get.result', { id: videoId, userId }) + // Filter may return null/undefined value to forbid video access + if (!video) return res.sendStatus(HttpStatusCode.NOT_FOUND_404) if (video.isOutdated()) { JobQueue.Instance.createJobAsync({ type: 'activitypub-refresher', payload: { type: 'video', url: video.url } }) diff --git a/server/server/lib/job-queue/handlers/video-live-ending.ts b/server/server/lib/job-queue/handlers/video-live-ending.ts index f10cc763c..dae6515d2 100644 --- a/server/server/lib/job-queue/handlers/video-live-ending.ts +++ b/server/server/lib/job-queue/handlers/video-live-ending.ts @@ -263,8 +263,6 @@ async function assignReplayFilesToVideo (options: { fps, isAAC: audioStream?.codec_name === 'aac' }) - - logger.error('coucou') } catch (err) { logger.error('Cannot generate HLS playlist resolution from TS files.', { err }) }