X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fvideos%2Findex.ts;h=7f5e74626e401714667d6be9c53d702e04116250;hb=0c948c1659c0a6010f2bf58c402b1c9af192aa5e;hp=c07430e6c85589a1c71de45f4d05853dbc63f3bb;hpb=0f320037e689b2778959c12ddd4ce790f6e4ae4f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index c07430e6c..7f5e74626 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -244,7 +244,7 @@ async function addVideo (req: express.Request, res: express.Response, videoPhysi video.VideoFiles = [ videoFile ] - if (videoInfo.tags) { + if (videoInfo.tags !== undefined) { const tagInstances = await TagModel.findOrCreateTags(videoInfo.tags, t) await video.$set('Tags', tagInstances, sequelizeOptions) @@ -267,7 +267,8 @@ async function addVideo (req: express.Request, res: express.Response, videoPhysi if (CONFIG.TRANSCODING.ENABLED === true) { // Put uuid because we don't have id auto incremented for now const dataInput = { - videoUUID: videoCreated.uuid + videoUUID: videoCreated.uuid, + isNewVideo: true } await JobQueue.Instance.createJob({ type: 'video-file', payload: dataInput }) @@ -332,7 +333,7 @@ async function updateVideo (req: express.Request, res: express.Response) { const videoInstanceUpdated = await videoInstance.save(sequelizeOptions) // Video tags update? - if (videoInfoToUpdate.tags) { + if (videoInfoToUpdate.tags !== undefined) { const tagInstances = await TagModel.findOrCreateTags(videoInfoToUpdate.tags, t) await videoInstanceUpdated.$set('Tags', tagInstances, sequelizeOptions) @@ -341,7 +342,7 @@ async function updateVideo (req: express.Request, res: express.Response) { // Video channel update? if (res.locals.videoChannel && videoInstanceUpdated.channelId !== res.locals.videoChannel.id) { - await videoInstanceUpdated.$set('VideoChannel', res.locals.videoChannel) + await videoInstanceUpdated.$set('VideoChannel', res.locals.videoChannel, { transaction: t }) videoInstance.VideoChannel = res.locals.videoChannel if (wasPrivateVideo === false) await changeVideoChannelShare(videoInstanceUpdated, oldVideoChannel, t)