mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(media): stream large files and honour size settings (#3387)
This commit is contained in:
1 parent
6acd7f3d22
commit
45b78a13c2
97 files changed
+2547
-409
No files matched your search
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {MAX_BIO_LENGTH} from '@fluxer/constants/src/LimitConstants';
|
||||
import {BASE64_IMAGE_MAX_SIZE, MAX_BIO_LENGTH} from '@fluxer/constants/src/LimitConstants';
|
||||
|
||||
export const LIMIT_KEYS = [
|
||||
'avatar_max_size',
|
||||
@@ -320,6 +320,8 @@ export const LIMIT_KEY_METADATA: Record<LimitKey, LimitKeyMetadata> = {
|
||||
scope: 'guild',
|
||||
isToggle: false,
|
||||
unit: 'bytes',
|
||||
min: 1,
|
||||
max: BASE64_IMAGE_MAX_SIZE,
|
||||
},
|
||||
sticker_max_size: {
|
||||
key: 'sticker_max_size',
|
||||
@@ -329,6 +331,8 @@ export const LIMIT_KEY_METADATA: Record<LimitKey, LimitKeyMetadata> = {
|
||||
scope: 'guild',
|
||||
isToggle: false,
|
||||
unit: 'bytes',
|
||||
min: 1,
|
||||
max: BASE64_IMAGE_MAX_SIZE,
|
||||
},
|
||||
max_attachment_file_size: {
|
||||
key: 'max_attachment_file_size',
|
||||
@@ -347,6 +351,8 @@ export const LIMIT_KEY_METADATA: Record<LimitKey, LimitKeyMetadata> = {
|
||||
scope: 'user',
|
||||
isToggle: false,
|
||||
unit: 'bytes',
|
||||
min: 1,
|
||||
max: BASE64_IMAGE_MAX_SIZE,
|
||||
},
|
||||
max_custom_backgrounds: {
|
||||
key: 'max_custom_backgrounds',
|
||||
|
||||
@@ -78,6 +78,7 @@ export const STICKER_MAX_SIZE = ASSET_FORMAT_POLICY.sticker.maxBytes;
|
||||
export const ATTACHMENT_MAX_SIZE_PREMIUM = 500 * 1024 * 1024;
|
||||
export const ATTACHMENT_MAX_SIZE_NON_PREMIUM = 25 * 1024 * 1024;
|
||||
export const ATTACHMENT_MAX_SIZE_BOT = 50 * 1024 * 1024;
|
||||
export const BASE64_IMAGE_MAX_SIZE = 100 * 1024 * 1024;
|
||||
export const ATTACHMENT_UPLOAD_CHUNK_THRESHOLD = 10 * 1024 * 1024;
|
||||
const ATTACHMENT_UPLOAD_MIN_CHUNK_SIZE = 10 * 1024 * 1024;
|
||||
const ATTACHMENT_UPLOAD_CHUNK_SIZE_STEP = 1 * 1024 * 1024;
|
||||
|
||||
Reference in new issue
Block a user