diff --git a/controllers/albumsController.js b/controllers/albumsController.js index 2b27dfa..57bbc5c 100644 --- a/controllers/albumsController.js +++ b/controllers/albumsController.js @@ -117,7 +117,7 @@ albumsController.get = async (req, res, next) => { file.file = `${config.domain}/${file.name}` const ext = path.extname(file.name).toLowerCase() - if (utils.imageExtensions.includes(ext) || utils.videoExtensions.includes(ext)) { + if ((config.uploads.generateImageThumbnails && utils.imageExtensions.includes(ext)) || (config.uploads.generateVideoThumbnails && utils.videoExtensions.includes(ext))) { file.thumb = `${config.domain}/thumbs/${file.name.slice(0, -ext.length)}.png` } } diff --git a/controllers/uploadController.js b/controllers/uploadController.js index ee8cc19..1918897 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -146,7 +146,7 @@ uploadsController.processFilesForDisplay = async (req, res, files, existingFiles for (let file of files) { let ext = path.extname(file.name).toLowerCase() - if (utils.imageExtensions.includes(ext) || utils.videoExtensions.includes(ext)) { + if ((config.uploads.generateImageThumbnails && utils.imageExtensions.includes(ext)) || (config.uploads.generateVideoThumbnails && utils.videoExtensions.includes(ext))) { file.thumb = `${basedomain}/thumbs/${file.name.slice(0, -ext.length)}.png` utils.generateThumbs(file) } @@ -259,7 +259,7 @@ uploadsController.list = async (req, res) => { } let ext = path.extname(file.name).toLowerCase() - if (utils.imageExtensions.includes(ext) || utils.videoExtensions.includes(ext)) { + if ((config.uploads.generateImageThumbnails && utils.imageExtensions.includes(ext)) || (config.uploads.generateVideoThumbnails && utils.videoExtensions.includes(ext))) { file.thumb = `${basedomain}/thumbs/${file.name.slice(0, -ext.length)}.png` } } diff --git a/routes/album.js b/routes/album.js index 56d2211..f3c068d 100644 --- a/routes/album.js +++ b/routes/album.js @@ -19,7 +19,7 @@ routes.get('/a/:identifier', async (req, res, next) => { file.file = `${basedomain}/${file.name}` let ext = path.extname(file.name).toLowerCase() - if (utils.imageExtensions.includes(ext) || utils.videoExtensions.includes(ext)) { + if ((config.uploads.generateImageThumbnails && utils.imageExtensions.includes(ext)) || (config.uploads.generateVideoThumbnails && utils.videoExtensions.includes(ext))) { file.thumb = `${basedomain}/thumbs/${file.name.slice(0, -ext.length)}.png` /*