Add option to disable thumbnail generation, opting for raw images instead

This commit is contained in:
lsaa
2023-04-28 17:34:32 -03:00
parent e06b8b959b
commit 8ef534b84b
2 changed files with 7 additions and 1 deletions

View File

@ -2098,6 +2098,11 @@ app.get('/thumbnail', jsonParser, async function (request, response) {
return response.sendStatus(403);
}
if (config.disableThumbnails == true) {
const pathToOriginalFile = path.join(getOriginalFolder(type), file);
return response.sendFile(pathToOriginalFile, { root: __dirname });
}
const pathToCachedFile = await generateThumbnail(type, file);
if (!pathToCachedFile) {