aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/config.ts14
-rw-r--r--server/controllers/api/users.ts1
-rw-r--r--server/controllers/api/videos/import.ts4
3 files changed, 16 insertions, 3 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 411b13539..acbeab70b 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -65,6 +65,13 @@ async function getConfig (req: express.Request, res: express.Response, next: exp
65 transcoding: { 65 transcoding: {
66 enabledResolutions 66 enabledResolutions
67 }, 67 },
68 import: {
69 video: {
70 http: {
71 enabled: CONFIG.IMPORT.VIDEOS.HTTP.ENABLED
72 }
73 }
74 },
68 avatar: { 75 avatar: {
69 file: { 76 file: {
70 size: { 77 size: {
@@ -225,6 +232,13 @@ function customConfig (): CustomConfig {
225 '720p': CONFIG.TRANSCODING.RESOLUTIONS[ '720p' ], 232 '720p': CONFIG.TRANSCODING.RESOLUTIONS[ '720p' ],
226 '1080p': CONFIG.TRANSCODING.RESOLUTIONS[ '1080p' ] 233 '1080p': CONFIG.TRANSCODING.RESOLUTIONS[ '1080p' ]
227 } 234 }
235 },
236 import: {
237 videos: {
238 http: {
239 enabled: CONFIG.IMPORT.VIDEOS.HTTP.ENABLED
240 }
241 }
228 } 242 }
229 } 243 }
230} 244}
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index 6e5f9913e..879ba3f91 100644
--- a/server/controllers/api/users.ts
+++ b/server/controllers/api/users.ts
@@ -68,7 +68,6 @@ usersRouter.get('/me/video-quota-used',
68 asyncMiddleware(getUserVideoQuotaUsed) 68 asyncMiddleware(getUserVideoQuotaUsed)
69) 69)
70 70
71
72usersRouter.get('/me/videos/imports', 71usersRouter.get('/me/videos/imports',
73 authenticate, 72 authenticate,
74 paginationValidator, 73 paginationValidator,
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts
index 33ac83cb9..ee11b0741 100644
--- a/server/controllers/api/videos/import.ts
+++ b/server/controllers/api/videos/import.ts
@@ -77,7 +77,7 @@ async function addVideoImport (req: express.Request, res: express.Response) {
77 video.url = getVideoActivityPubUrl(video) 77 video.url = getVideoActivityPubUrl(video)
78 78
79 // Process thumbnail file? 79 // Process thumbnail file?
80 const thumbnailField = req.files['thumbnailfile'] 80 const thumbnailField = req.files ? req.files['thumbnailfile'] : undefined
81 let downloadThumbnail = true 81 let downloadThumbnail = true
82 if (thumbnailField) { 82 if (thumbnailField) {
83 const thumbnailPhysicalFile = thumbnailField[ 0 ] 83 const thumbnailPhysicalFile = thumbnailField[ 0 ]
@@ -86,7 +86,7 @@ async function addVideoImport (req: express.Request, res: express.Response) {
86 } 86 }
87 87
88 // Process preview file? 88 // Process preview file?
89 const previewField = req.files['previewfile'] 89 const previewField = req.files ? req.files['previewfile'] : undefined
90 let downloadPreview = true 90 let downloadPreview = true
91 if (previewField) { 91 if (previewField) {
92 const previewPhysicalFile = previewField[0] 92 const previewPhysicalFile = previewField[0]