mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
fix(media-proxy): serve and request images on one size ladder (#1833)
This commit is contained in:
@@ -33,9 +33,13 @@ const MEDIA_PROXY_IMAGE_SIZE_QUERY_VALUES = [
|
||||
'3072',
|
||||
'4096',
|
||||
'8192',
|
||||
'12000',
|
||||
'16384',
|
||||
] as const;
|
||||
|
||||
export type MediaProxyImageSizeQueryValue = (typeof MEDIA_PROXY_IMAGE_SIZE_QUERY_VALUES)[number];
|
||||
type ParseNumericLiteral<T extends string> = T extends `${infer N extends number}` ? N : never;
|
||||
export type MediaProxyImageSize = ParseNumericLiteral<MediaProxyImageSizeQueryValue>;
|
||||
|
||||
export const MEDIA_PROXY_IMAGE_SIZES: ReadonlyArray<MediaProxyImageSize> = MEDIA_PROXY_IMAGE_SIZE_QUERY_VALUES.map(
|
||||
(value) => Number(value) as MediaProxyImageSize,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user