aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-07 15:17:17 +0200
committerChocobozzz <me@florianbigard.com>2018-08-08 09:30:31 +0200
commit3e17515e2996b79e23f569c296051a91af3fcbe4 (patch)
treed1c06c394a9f4b1d8646625612c2d5d3e02e9191 /server/controllers/api
parent187501f8b8e334f043ae1e9af3c9d4f45ea0e6c1 (diff)
downloadPeerTube-3e17515e2996b79e23f569c296051a91af3fcbe4.tar.gz
PeerTube-3e17515e2996b79e23f569c296051a91af3fcbe4.tar.zst
PeerTube-3e17515e2996b79e23f569c296051a91af3fcbe4.zip
Add torrent tests
Diffstat (limited to 'server/controllers/api')
-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