From 524cf5ec5b8f97a44b778dfed70e11efc2b35c9f Mon Sep 17 00:00:00 2001 From: mikiher Date: Tue, 29 Oct 2024 21:42:44 +0200 Subject: [PATCH] Fix incorrect call to handleDownloadError --- server/controllers/LibraryItemController.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/controllers/LibraryItemController.js b/server/controllers/LibraryItemController.js index 0b4d3d0c..a51a6e06 100644 --- a/server/controllers/LibraryItemController.js +++ b/server/controllers/LibraryItemController.js @@ -115,7 +115,7 @@ class LibraryItemController { res.sendStatus(200) } - #handleDownloadError(error, res) { + static handleDownloadError(error, res) { if (!res.headersSent) { if (error.code === 'ENOENT') { return res.status(404).send('File not found') @@ -158,7 +158,7 @@ class LibraryItemController { Logger.info(`[LibraryItemController] Downloaded item "${itemTitle}" at "${libraryItemPath}"`) } catch (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}"`) } catch (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}"`) } catch (error) { Logger.error(`[LibraryItemController] Failed to download ebook file "${ebookFilePath}"`, error) - this.#handleDownloadError(error, res) + LibraryItemController.handleDownloadError(error, res) } }