mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Fix incorrect call to handleDownloadError
This commit is contained in:
parent
50fd659749
commit
524cf5ec5b
@ -115,7 +115,7 @@ class LibraryItemController {
|
|||||||
res.sendStatus(200)
|
res.sendStatus(200)
|
||||||
}
|
}
|
||||||
|
|
||||||
#handleDownloadError(error, res) {
|
static handleDownloadError(error, res) {
|
||||||
if (!res.headersSent) {
|
if (!res.headersSent) {
|
||||||
if (error.code === 'ENOENT') {
|
if (error.code === 'ENOENT') {
|
||||||
return res.status(404).send('File not found')
|
return res.status(404).send('File not found')
|
||||||
@ -158,7 +158,7 @@ class LibraryItemController {
|
|||||||
Logger.info(`[LibraryItemController] Downloaded item "${itemTitle}" at "${libraryItemPath}"`)
|
Logger.info(`[LibraryItemController] Downloaded item "${itemTitle}" at "${libraryItemPath}"`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(`[LibraryItemController] Download failed for item "${itemTitle}" at "${libraryItemPath}"`, error)
|
Logger.error(`[LibraryItemController] Download failed for item "${itemTitle}" at "${libraryItemPath}"`, error)
|
||||||
this.#handleDownloadError(error, res)
|
LibraryItemController.handleDownloadError(error, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -865,7 +865,7 @@ class LibraryItemController {
|
|||||||
Logger.info(`[LibraryItemController] Downloaded file "${libraryFile.metadata.path}"`)
|
Logger.info(`[LibraryItemController] Downloaded file "${libraryFile.metadata.path}"`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(`[LibraryItemController] Failed to download file "${libraryFile.metadata.path}"`, error)
|
Logger.error(`[LibraryItemController] Failed to download file "${libraryFile.metadata.path}"`, error)
|
||||||
this.#handleDownloadError(error, res)
|
LibraryItemController.handleDownloadError(error, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -909,7 +909,7 @@ class LibraryItemController {
|
|||||||
Logger.info(`[LibraryItemController] Downloaded ebook file "${ebookFilePath}"`)
|
Logger.info(`[LibraryItemController] Downloaded ebook file "${ebookFilePath}"`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(`[LibraryItemController] Failed to download ebook file "${ebookFilePath}"`, error)
|
Logger.error(`[LibraryItemController] Failed to download ebook file "${ebookFilePath}"`, error)
|
||||||
this.#handleDownloadError(error, res)
|
LibraryItemController.handleDownloadError(error, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user