diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-18 09:29:46 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-18 10:47:26 +0100 |
commit | 2f0a0ae21789ada8429c91a253288f738857a19b (patch) | |
tree | ea6bb708b3a65723b8fbf2d438cc6be88205b033 /server/lib/uploadx.ts | |
parent | 743dab5517d4501f6b35cfc795de6c8b6f41ebb3 (diff) | |
download | PeerTube-2f0a0ae21789ada8429c91a253288f738857a19b.tar.gz PeerTube-2f0a0ae21789ada8429c91a253288f738857a19b.tar.zst PeerTube-2f0a0ae21789ada8429c91a253288f738857a19b.zip |
Upgrade uploadx dependency
Diffstat (limited to 'server/lib/uploadx.ts')
-rw-r--r-- | server/lib/uploadx.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/lib/uploadx.ts b/server/lib/uploadx.ts index 36f5a556c..34a4461f0 100644 --- a/server/lib/uploadx.ts +++ b/server/lib/uploadx.ts | |||
@@ -5,9 +5,13 @@ import { Uploadx } from '@uploadx/core' | |||
5 | const uploadx = new Uploadx({ | 5 | const uploadx = new Uploadx({ |
6 | directory: getResumableUploadPath(), | 6 | directory: getResumableUploadPath(), |
7 | // Could be big with thumbnails/previews | 7 | // Could be big with thumbnails/previews |
8 | maxMetadataSize: '10MB' | 8 | maxMetadataSize: '10MB', |
9 | userIdentifier: (_, res: express.Response) => { | ||
10 | if (!res.locals.oauth) return undefined | ||
11 | |||
12 | return res.locals.oauth.token.user.id + '' | ||
13 | } | ||
9 | }) | 14 | }) |
10 | uploadx.getUserId = (_, res: express.Response) => res.locals.oauth?.token.user.id | ||
11 | 15 | ||
12 | export { | 16 | export { |
13 | uploadx | 17 | uploadx |