From 72433932724364c5c2301e73ff06b6f37467884c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 11 Oct 2023 15:58:16 +0200 Subject: [PATCH] Fix signup and import --- server/core/controllers/api/videos/import.ts | 3 ++- server/core/lib/signup.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/core/controllers/api/videos/import.ts b/server/core/controllers/api/videos/import.ts index 185215cc9..5e6694899 100644 --- a/server/core/controllers/api/videos/import.ts +++ b/server/core/controllers/api/videos/import.ts @@ -237,7 +237,8 @@ async function processTorrentOrAbortRequest (req: express.Request, res: express. torrentfile.path = newTorrentPath const buf = await readFile(torrentfile.path) - const parsedTorrent = parseTorrent(buf) as Instance + // FIXME: typings: parseTorrent now returns an async result + const parsedTorrent = await (parseTorrent(buf) as unknown as Promise) if (parsedTorrent.files.length !== 1) { cleanUpReqFiles(req) diff --git a/server/core/lib/signup.ts b/server/core/lib/signup.ts index a5e9e93c9..f4e0aef65 100644 --- a/server/core/lib/signup.ts +++ b/server/core/lib/signup.ts @@ -38,7 +38,7 @@ export function isSignupAllowedForCurrentIP (ip: string) { let matched = '' // if there is a valid, non-empty whitelist, we exclude all unknown addresses too - if (CONFIG.SIGNUP.FILTERS.CIDR.WHITELIST.filter(cidr => isIPV4Cidr(cidr) || isIPV6Cidr(cidr))) { + if (CONFIG.SIGNUP.FILTERS.CIDR.WHITELIST.some(cidr => isIPV4Cidr(cidr) || isIPV6Cidr(cidr))) { excludeList.push('unknown') }