1
0
Fork 0

Support empty value returned by video get filter

This commit is contained in:
Chocobozzz 2023-10-03 09:36:00 +02:00
parent 9864a0cae1
commit 3601872153
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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 } })

View file

@ -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 })
}