added file icon image

pull/29/head
tycrek 3 years ago
parent b9d6a8d0be
commit 29f52d58ca
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -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));

@ -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));

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Loading…
Cancel
Save