Add Discord-hosted preview caching (C11)
This commit is contained in:
@@ -754,6 +754,15 @@ export function startWebUi(deps: WebUiDeps): WebUiHandle {
|
||||
})
|
||||
);
|
||||
|
||||
app.get(
|
||||
"/api/media/:scrapeId/:itemId/thumb",
|
||||
wrap(async (req, res) => {
|
||||
const file = deps.media.getMediaThumb(String(req.params.scrapeId), Number(req.params.itemId));
|
||||
if (!file) throw new HttpError(404, "thumb not found");
|
||||
res.type(file.contentType).sendFile(file.path);
|
||||
})
|
||||
);
|
||||
|
||||
app.get(
|
||||
"/api/media/:scrapeId/:itemId/file",
|
||||
wrap(async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user