Skip to content

Commit 37b1fa1

Browse files
chore: tighten media upload comments
1 parent 64d3b0a commit 37b1fa1

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

packages/admin/src/lib/api/media.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ import {
1313
type FindManyResult,
1414
} from "./client.js";
1515

16-
/**
17-
* Maximum length of the media filename search term. Mirrors the server-side
18-
* zod schema (`q: z.string().trim().min(1).max(200)`); keep in sync.
19-
*/
2016
export const MEDIA_SEARCH_MAX_LENGTH = 200;
2117

2218
/** Trim and clamp a search term to the server-accepted range. */

packages/core/src/astro/routes/api/media/[id]/confirm.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,7 @@ export const POST: APIRoute = async ({ params, request, locals }) => {
184184
}
185185
}
186186

187-
// For images, read the just-uploaded bytes back from storage once to
188-
// generate LQIP placeholders (and server-side dimensions as a fallback).
189-
// The signed-URL flow uploads directly to storage, so this confirm is the
190-
// only point at which the server sees the bytes. Best-effort: a decode
191-
// failure must not block the upload from being marked ready. We also cap
192-
// the download size — buffering a large original into a Worker heap to
193-
// compute a 32px blurhash would OOM on the uploads the signed-URL path
194-
// exists to support, so oversized files skip the server-side placeholder.
187+
// LQIP is best-effort; oversized images skip server-side placeholders.
195188
let blurhash: string | undefined;
196189
let dominantColor: string | undefined;
197190
let width = body.width;

0 commit comments

Comments
 (0)