More experimental changes to compliment the previous commit.
This commit is contained in:
Bobby Wibowo 2018-02-07 13:32:26 +07:00
parent 66f3b0739d
commit efbaa24b30
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 4 additions and 4 deletions

View File

@ -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`
}
}

View File

@ -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`
}
}

View File

@ -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`
/*