diff options
author | Chocobozzz <me@florianbigard.com> | 2023-10-03 09:36:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-10-03 09:36:00 +0200 |
commit | 3601872153ee06a2b58b7fb45898e2b7acbb62ea (patch) | |
tree | 93899551498fc482c9c6585b0cc2ef6a6f71e1ce /server | |
parent | 9864a0cae103ab5df127f68672fc3d6d363c46b7 (diff) | |
download | PeerTube-3601872153ee06a2b58b7fb45898e2b7acbb62ea.tar.gz PeerTube-3601872153ee06a2b58b7fb45898e2b7acbb62ea.tar.zst PeerTube-3601872153ee06a2b58b7fb45898e2b7acbb62ea.zip |
Support empty value returned by video get filter
Diffstat (limited to 'server')
-rw-r--r-- | server/server/controllers/api/videos/index.ts | 2 | ||||
-rw-r--r-- | server/server/lib/job-queue/handlers/video-live-ending.ts | 2 |
2 files changed, 2 insertions, 2 deletions
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) { | |||
155 | const userId = res.locals.oauth?.token.User.id | 155 | const userId = res.locals.oauth?.token.User.id |
156 | 156 | ||
157 | const video = await Hooks.wrapObject(res.locals.videoAPI, 'filter:api.video.get.result', { id: videoId, userId }) | 157 | const video = await Hooks.wrapObject(res.locals.videoAPI, 'filter:api.video.get.result', { id: videoId, userId }) |
158 | // Filter may return null/undefined value to forbid video access | ||
159 | if (!video) return res.sendStatus(HttpStatusCode.NOT_FOUND_404) | ||
158 | 160 | ||
159 | if (video.isOutdated()) { | 161 | if (video.isOutdated()) { |
160 | JobQueue.Instance.createJobAsync({ type: 'activitypub-refresher', payload: { type: 'video', url: video.url } }) | 162 | 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: { | |||
263 | fps, | 263 | fps, |
264 | isAAC: audioStream?.codec_name === 'aac' | 264 | isAAC: audioStream?.codec_name === 'aac' |
265 | }) | 265 | }) |
266 | |||
267 | logger.error('coucou') | ||
268 | } catch (err) { | 266 | } catch (err) { |
269 | logger.error('Cannot generate HLS playlist resolution from TS files.', { err }) | 267 | logger.error('Cannot generate HLS playlist resolution from TS files.', { err }) |
270 | } | 268 | } |