mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-24 09:49:24 +02:00
Remove sharp in favor of ffmpeg, fallback to cover
This commit is contained in:
parent
9452d0eca9
commit
d6ae50f89a
5 changed files with 42 additions and 34 deletions
|
@ -234,7 +234,7 @@ class BookController {
|
|||
async getCover(req, res) {
|
||||
let { query: { width, height, format }, params: { id } } = req
|
||||
var audiobook = this.db.audiobooks.find(a => a.id === id)
|
||||
if (!audiobook || !audiobook.book.coverFullPath) return res.sendStatus(404)
|
||||
if (!audiobook || (!audiobook.book.coverFullPath && !audiobook.book.cover)) return res.sendStatus(404)
|
||||
|
||||
// Check user can access this audiobooks library
|
||||
if (!req.user.checkCanAccessLibrary(audiobook.libraryId)) {
|
||||
|
@ -242,7 +242,7 @@ class BookController {
|
|||
}
|
||||
|
||||
const options = {
|
||||
format: format || (reqSupportsWebp(req) ? 'webp' : 'jpg'),
|
||||
format: format || (reqSupportsWebp(req) ? 'webp' : 'jpeg'),
|
||||
height: height ? parseInt(height) : null,
|
||||
width: width ? parseInt(width) : null
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue