Serves and changes dumps' thumbnails, a sub-resource of their dump. The
cards and pages that show a file dump build the URL with
dumpThumbnailUrl, and the edit page uploads a custom one. Thumbnails made
from an upload are generated on first request by lib/ffmpeg.ts, which keeps
them.
GET /api/dumps/:dumpId/thumbnail?v=&w=&token=— public; a private dump's thumbnail needs its poster's mediatoken. Serves the dump's custom thumbnail, else one made from its upload: a still of a video, or its image. An image comes scaled down tow(shared/image.ts), or to the widest of those widths without one, and as it is when no copy can be made; 404 when there is neither.PUT /api/dumps/:dumpId/thumbnail— signed in, as its poster or withdump:moderate. Replaces its custom thumbnail (multipartfile, at most 5 MB).DELETE /api/dumps/:dumpId/thumbnail— signed in, as its poster or withdump:moderate. Removes its custom thumbnail.
v
default: Router
Mounted by api/main.ts behind the error, Open Graph and CORS middleware.
An APIException thrown by a handler becomes the JSON error response there.
Usage
import * as mod from "api/routes/thumbnails.ts";