video.VideoFiles = [ videoFile ]
- if (videoInfo.tags) {
+ if (videoInfo.tags !== undefined) {
const tagInstances = await TagModel.findOrCreateTags(videoInfo.tags, t)
await video.$set('Tags', tagInstances, sequelizeOptions)
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 })
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)
// 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)