aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-20 10:38:33 +0200
committerChocobozzz <me@florianbigard.com>2020-04-20 10:41:43 +0200
commit86ad0cde9e7e7cbe86dfd7642c9d9b807e17c172 (patch)
treee939620851db2690b568cb4660f749cda125146f /server/controllers/api/videos
parentb1770a0af464ad6350d156245b1abcc1395e142e (diff)
downloadPeerTube-86ad0cde9e7e7cbe86dfd7642c9d9b807e17c172.tar.gz
PeerTube-86ad0cde9e7e7cbe86dfd7642c9d9b807e17c172.tar.zst
PeerTube-86ad0cde9e7e7cbe86dfd7642c9d9b807e17c172.zip
Add licence and language support to y-dl imports
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r--server/controllers/api/videos/import.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts
index fb2de5dc0..be96ef42c 100644
--- a/server/controllers/api/videos/import.ts
+++ b/server/controllers/api/videos/import.ts
@@ -159,7 +159,7 @@ async function addYoutubeDLImport (req: express.Request, res: express.Response)
159 thumbnailModel = await processThumbnail(req, video) 159 thumbnailModel = await processThumbnail(req, video)
160 160
161 // Process video thumbnail from url if processing from request.files failed 161 // Process video thumbnail from url if processing from request.files failed
162 if (!thumbnailModel) { 162 if (!thumbnailModel && youtubeDLInfo.thumbnailUrl) {
163 thumbnailModel = await processThumbnailFromUrl(youtubeDLInfo.thumbnailUrl, video) 163 thumbnailModel = await processThumbnailFromUrl(youtubeDLInfo.thumbnailUrl, video)
164 } 164 }
165 165
@@ -169,7 +169,7 @@ async function addYoutubeDLImport (req: express.Request, res: express.Response)
169 previewModel = await processPreview(req, video) 169 previewModel = await processPreview(req, video)
170 170
171 // Process video preview from url if processing from request.files failed 171 // Process video preview from url if processing from request.files failed
172 if (!previewModel) { 172 if (!previewModel && youtubeDLInfo.thumbnailUrl) {
173 previewModel = await processPreviewFromUrl(youtubeDLInfo.thumbnailUrl, video) 173 previewModel = await processPreviewFromUrl(youtubeDLInfo.thumbnailUrl, video)
174 } 174 }
175 175
@@ -236,7 +236,7 @@ function buildVideo (channelId: number, body: VideoImportCreate, importData: You
236 remote: false, 236 remote: false,
237 category: body.category || importData.category, 237 category: body.category || importData.category,
238 licence: body.licence || importData.licence, 238 licence: body.licence || importData.licence,
239 language: body.language || undefined, 239 language: body.language || importData.language,
240 commentsEnabled: body.commentsEnabled !== false, // If the value is not "false", the default is "true" 240 commentsEnabled: body.commentsEnabled !== false, // If the value is not "false", the default is "true"
241 downloadEnabled: body.downloadEnabled !== false, 241 downloadEnabled: body.downloadEnabled !== false,
242 waitTranscoding: body.waitTranscoding || false, 242 waitTranscoding: body.waitTranscoding || false,