X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fuploadx.ts;h=34a4461f0b8303c3cd178360fe34d39647eea692;hb=57e4e1c1a95c3a81a967f54ecc2a510d8b0e129c;hp=11b1044db48f5fac6589baf3e96cf57d8bb88e05;hpb=d1a233d8d86ead1e3aa2350d5480eab3336b17d6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/uploadx.ts b/server/lib/uploadx.ts index 11b1044db..34a4461f0 100644 --- a/server/lib/uploadx.ts +++ b/server/lib/uploadx.ts @@ -2,8 +2,16 @@ import express from 'express' import { getResumableUploadPath } from '@server/helpers/upload' import { Uploadx } from '@uploadx/core' -const uploadx = new Uploadx({ directory: getResumableUploadPath() }) -uploadx.getUserId = (_, res: express.Response) => res.locals.oauth?.token.user.id +const uploadx = new Uploadx({ + directory: getResumableUploadPath(), + // Could be big with thumbnails/previews + maxMetadataSize: '10MB', + userIdentifier: (_, res: express.Response) => { + if (!res.locals.oauth) return undefined + + return res.locals.oauth.token.user.id + '' + } +}) export { uploadx