From faa9d434b4d681837ff2a87603337c2623419669 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Jun 2020 10:55:40 +0200 Subject: Update server dependencies --- server/controllers/api/users/index.ts | 4 +--- server/controllers/api/videos/import.ts | 2 +- server/controllers/api/videos/index.ts | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index c488f720b..06a43d7a3 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts @@ -53,15 +53,13 @@ import { tokensRouter } from '@server/controllers/api/users/token' const auditLogger = auditLoggerFactory('users') -// @ts-ignore const signupRateLimiter = RateLimit({ windowMs: CONFIG.RATES_LIMIT.SIGNUP.WINDOW_MS, max: CONFIG.RATES_LIMIT.SIGNUP.MAX, skipFailedRequests: true }) -// @ts-ignore -const askSendEmailLimiter = new RateLimit({ +const askSendEmailLimiter = RateLimit({ windowMs: CONFIG.RATES_LIMIT.ASK_SEND_EMAIL.WINDOW_MS, max: CONFIG.RATES_LIMIT.ASK_SEND_EMAIL.MAX }) diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index b4f70a086..ec270148d 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts @@ -68,7 +68,7 @@ export { function addVideoImport (req: express.Request, res: express.Response) { if (req.body.targetUrl) return addYoutubeDLImport(req, res) - const file = req.files && req.files['torrentfile'] ? req.files['torrentfile'][0] : undefined + const file = req.files?.['torrentfile']?.[0] if (req.body.magnetUri || file) return addTorrentImport(req, res, file) } diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 8048c568c..3ca5a9192 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -317,11 +317,11 @@ async function updateVideo (req: express.Request, res: express.Response) { const hadPrivacyForFederation = videoInstance.hasPrivacyForFederation() // Process thumbnail or create it from the video - const thumbnailModel = req.files && req.files['thumbnailfile'] + const thumbnailModel = req.files?.['thumbnailfile'] ? await createVideoMiniatureFromExisting(req.files['thumbnailfile'][0].path, videoInstance, ThumbnailType.MINIATURE, false) : undefined - const previewModel = req.files && req.files['previewfile'] + const previewModel = req.files?.['previewfile'] ? await createVideoMiniatureFromExisting(req.files['previewfile'][0].path, videoInstance, ThumbnailType.PREVIEW, false) : undefined -- cgit v1.2.3