From 4de65b43692ea3fdd0526d572a17583e3be96755 Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Mon, 19 Aug 2024 21:00:16 -0700 Subject: [PATCH] Autoformat `parseComicMetadata` --- server/utils/parsers/parseComicMetadata.js | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/utils/parsers/parseComicMetadata.js b/server/utils/parsers/parseComicMetadata.js index 8d78b126..3f6c3fb7 100644 --- a/server/utils/parsers/parseComicMetadata.js +++ b/server/utils/parsers/parseComicMetadata.js @@ -7,12 +7,12 @@ const { xmlToJSON } = require('../index') const parseComicInfoMetadata = require('./parseComicInfoMetadata') /** - * - * @param {string} filepath + * + * @param {string} filepath * @returns {Promise} */ async function getComicFileBuffer(filepath) { - if (!await fs.pathExists(filepath)) { + if (!(await fs.pathExists(filepath))) { Logger.error(`Comic path does not exist "${filepath}"`) return null } @@ -26,10 +26,10 @@ async function getComicFileBuffer(filepath) { /** * Extract cover image from comic return true if success - * - * @param {string} comicPath - * @param {string} comicImageFilepath - * @param {string} outputCoverPath + * + * @param {string} comicPath + * @param {string} comicImageFilepath + * @param {string} outputCoverPath * @returns {Promise} */ async function extractCoverImage(comicPath, comicImageFilepath, outputCoverPath) { @@ -56,8 +56,8 @@ module.exports.extractCoverImage = extractCoverImage /** * Parse metadata from comic - * - * @param {import('../../models/Book').EBookFileObject} ebookFile + * + * @param {import('../../models/Book').EBookFileObject} ebookFile * @returns {Promise} */ async function parse(ebookFile) { @@ -79,7 +79,7 @@ async function parse(ebookFile) { }) let metadata = null - const comicInfo = fileObjects.find(fo => fo.file.name === 'ComicInfo.xml') + const comicInfo = fileObjects.find((fo) => fo.file.name === 'ComicInfo.xml') if (comicInfo) { const comicInfoEntry = await comicInfo.file.extract() if (comicInfoEntry?.fileData) { @@ -97,7 +97,7 @@ async function parse(ebookFile) { metadata } - const firstImage = fileObjects.find(fo => globals.SupportedImageTypes.includes(Path.extname(fo.file.name).toLowerCase().slice(1))) + const firstImage = fileObjects.find((fo) => globals.SupportedImageTypes.includes(Path.extname(fo.file.name).toLowerCase().slice(1))) if (firstImage?.file?._path) { payload.ebookCoverPath = firstImage.file._path } else { @@ -106,4 +106,4 @@ async function parse(ebookFile) { return payload } -module.exports.parse = parse \ No newline at end of file +module.exports.parse = parse