mirror of https://github.com/tycrek/ass.git
added file icon image
This commit is contained in:
parent
b9d6a8d0be
commit
29f52d58ca
|
@ -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…
Reference in New Issue