aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-16 09:28:18 +0200
committerChocobozzz <me@florianbigard.com>2018-05-16 09:42:56 +0200
commit2efd32f697549c59337db5177a93749af8e605d8 (patch)
tree42adaa4bb67b6aa48dcd4fb660616fb37b611573 /server/controllers
parent17c49e60b367868c80f44b9921793dc3a2d9adaa (diff)
downloadPeerTube-2efd32f697549c59337db5177a93749af8e605d8.tar.gz
PeerTube-2efd32f697549c59337db5177a93749af8e605d8.tar.zst
PeerTube-2efd32f697549c59337db5177a93749af8e605d8.zip
Fix updating video tags to empty field
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/videos/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index c07430e6c..bcf1eaee6 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
244 244
245 video.VideoFiles = [ videoFile ] 245 video.VideoFiles = [ videoFile ]
246 246
247 if (videoInfo.tags) { 247 if (videoInfo.tags !== undefined) {
248 const tagInstances = await TagModel.findOrCreateTags(videoInfo.tags, t) 248 const tagInstances = await TagModel.findOrCreateTags(videoInfo.tags, t)
249 249
250 await video.$set('Tags', tagInstances, sequelizeOptions) 250 await video.$set('Tags', tagInstances, sequelizeOptions)
@@ -332,7 +332,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
332 const videoInstanceUpdated = await videoInstance.save(sequelizeOptions) 332 const videoInstanceUpdated = await videoInstance.save(sequelizeOptions)
333 333
334 // Video tags update? 334 // Video tags update?
335 if (videoInfoToUpdate.tags) { 335 if (videoInfoToUpdate.tags !== undefined) {
336 const tagInstances = await TagModel.findOrCreateTags(videoInfoToUpdate.tags, t) 336 const tagInstances = await TagModel.findOrCreateTags(videoInfoToUpdate.tags, t)
337 337
338 await videoInstanceUpdated.$set('Tags', tagInstances, sequelizeOptions) 338 await videoInstanceUpdated.$set('Tags', tagInstances, sequelizeOptions)