aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/videos/import.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts
index ee11b0741..30a7d816c 100644
--- a/server/controllers/api/videos/import.ts
+++ b/server/controllers/api/videos/import.ts
@@ -62,7 +62,7 @@ async function addVideoImport (req: express.Request, res: express.Response) {
62 remote: false, 62 remote: false,
63 category: body.category || youtubeDLInfo.category, 63 category: body.category || youtubeDLInfo.category,
64 licence: body.licence || youtubeDLInfo.licence, 64 licence: body.licence || youtubeDLInfo.licence,
65 language: undefined, 65 language: body.language || undefined,
66 commentsEnabled: body.commentsEnabled || true, 66 commentsEnabled: body.commentsEnabled || true,
67 waitTranscoding: body.waitTranscoding || false, 67 waitTranscoding: body.waitTranscoding || false,
68 state: VideoState.TO_IMPORT, 68 state: VideoState.TO_IMPORT,
@@ -102,8 +102,9 @@ async function addVideoImport (req: express.Request, res: express.Response) {
102 videoCreated.VideoChannel = res.locals.videoChannel 102 videoCreated.VideoChannel = res.locals.videoChannel
103 103
104 // Set tags to the video 104 // Set tags to the video
105 if (youtubeDLInfo.tags !== undefined) { 105 const tags = body.tags ? body.tags : youtubeDLInfo.tags
106 const tagInstances = await TagModel.findOrCreateTags(youtubeDLInfo.tags, t) 106 if (tags !== undefined) {
107 const tagInstances = await TagModel.findOrCreateTags(tags, t)
107 108
108 await videoCreated.$set('Tags', tagInstances, sequelizeOptions) 109 await videoCreated.$set('Tags', tagInstances, sequelizeOptions)
109 videoCreated.Tags = tagInstances 110 videoCreated.Tags = tagInstances
@@ -133,5 +134,5 @@ async function addVideoImport (req: express.Request, res: express.Response) {
133 134
134 auditLogger.create(res.locals.oauth.token.User.Account.Actor.getIdentifier(), new VideoImportAuditView(videoImport.toFormattedJSON())) 135 auditLogger.create(res.locals.oauth.token.User.Account.Actor.getIdentifier(), new VideoImportAuditView(videoImport.toFormattedJSON()))
135 136
136 return res.json(videoImport.toFormattedJSON()) 137 return res.json(videoImport.toFormattedJSON()).end()
137} 138}