aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/import.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/import.ts')
-rw-r--r--server/controllers/api/videos/import.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts
index 94dafcdbd..b2f73fa48 100644
--- a/server/controllers/api/videos/import.ts
+++ b/server/controllers/api/videos/import.ts
@@ -97,7 +97,7 @@ async function addTorrentImport (req: express.Request, res: express.Response, to
97 await processThumbnail(req, video) 97 await processThumbnail(req, video)
98 await processPreview(req, video) 98 await processPreview(req, video)
99 99
100 const tags = null 100 const tags = body.tags || undefined
101 const videoImportAttributes = { 101 const videoImportAttributes = {
102 magnetUri, 102 magnetUri,
103 torrentName, 103 torrentName,
@@ -224,11 +224,13 @@ function insertIntoDB (
224 videoCreated.VideoChannel = videoChannel 224 videoCreated.VideoChannel = videoChannel
225 225
226 // Set tags to the video 226 // Set tags to the video
227 if (tags !== undefined) { 227 if (tags) {
228 const tagInstances = await TagModel.findOrCreateTags(tags, t) 228 const tagInstances = await TagModel.findOrCreateTags(tags, t)
229 229
230 await videoCreated.$set('Tags', tagInstances, sequelizeOptions) 230 await videoCreated.$set('Tags', tagInstances, sequelizeOptions)
231 videoCreated.Tags = tagInstances 231 videoCreated.Tags = tagInstances
232 } else {
233 videoCreated.Tags = []
232 } 234 }
233 235
234 // Create video import object in database 236 // Create video import object in database