From c24ac1c18e26b6a24a4d294744908fb0c53ddf3c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 May 2017 14:29:58 +0200 Subject: Fix unset video language on video update --- server/controllers/api/videos.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/videos.js b/server/controllers/api/videos.js index 4a4c5e162..aeefaa555 100644 --- a/server/controllers/api/videos.js +++ b/server/controllers/api/videos.js @@ -444,12 +444,12 @@ function updateVideo (req, res, finalCallback) { transaction: t } - if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name) - if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category) - if (videoInfosToUpdate.licence) videoInstance.set('licence', videoInfosToUpdate.licence) - if (videoInfosToUpdate.language) videoInstance.set('language', videoInfosToUpdate.language) - if (videoInfosToUpdate.nsfw) videoInstance.set('nsfw', videoInfosToUpdate.nsfw) - if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) + if (videoInfosToUpdate.name !== undefined) videoInstance.set('name', videoInfosToUpdate.name) + if (videoInfosToUpdate.category !== undefined) videoInstance.set('category', videoInfosToUpdate.category) + if (videoInfosToUpdate.licence !== undefined) videoInstance.set('licence', videoInfosToUpdate.licence) + if (videoInfosToUpdate.language !== undefined) videoInstance.set('language', videoInfosToUpdate.language) + if (videoInfosToUpdate.nsfw !== undefined) videoInstance.set('nsfw', videoInfosToUpdate.nsfw) + if (videoInfosToUpdate.description !== undefined) videoInstance.set('description', videoInfosToUpdate.description) videoInstance.save(options).asCallback(function (err) { return callback(err, t, tagInstances) -- cgit v1.2.3