added file icon image

This commit is contained in:
tycrek 2021-07-07 18:15:25 -06:00
parent b9d6a8d0be
commit 29f52d58ca
No known key found for this signature in database
GPG Key ID: 25D74F3943625263
3 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ router.get('/direct*', (req, res, next) => data.get(req.ass.resourceId).then((fi
// Thumbnail response
router.get('/thumbnail', (req, res, next) =>
data.get(req.ass.resourceId)
.then(({ is, thumbnail }) => fs.readFile((!is || (is.image || is.video)) ? path(diskFilePath, 'thumbnails/', thumbnail) : 'views/ass-audio-icon.png'))
.then(({ is, thumbnail }) => fs.readFile((!is || (is.image || is.video)) ? path(diskFilePath, 'thumbnails/', thumbnail) : is.audio ? 'views/ass-audio-icon.png' : 'views/ass-file-icon.png'))
.then((fileData) => res.type('jpg').send(fileData))
.catch(next));

View File

@ -82,5 +82,5 @@ function getImageThumbnail(file) {
module.exports = (file) =>
new Promise((resolve, reject) =>
(file.is.video ? getVideoThumbnail : file.is.image ? getImageThumbnail : () => Promise.resolve())(file)
.then(() => resolve((file.is.video || file.is.image) ? getNewName(file.originalname) : 'views/ass-audio-icon.png'))
.then(() => resolve((file.is.video || file.is.image) ? getNewName(file.originalname) : file.is.audio ? 'views/ass-audio-icon.png' : 'views/ass-file-icon.png'))
.catch(reject));

BIN
views/ass-file-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB