Autoformat parseComicMetadata

This commit is contained in:
Nicholas Wallace 2024-08-19 21:00:16 -07:00
parent 26d2c5a8f0
commit 4de65b4369

View File

@ -12,7 +12,7 @@ const parseComicInfoMetadata = require('./parseComicInfoMetadata')
* @returns {Promise<Buffer>} * @returns {Promise<Buffer>}
*/ */
async function getComicFileBuffer(filepath) { async function getComicFileBuffer(filepath) {
if (!await fs.pathExists(filepath)) { if (!(await fs.pathExists(filepath))) {
Logger.error(`Comic path does not exist "${filepath}"`) Logger.error(`Comic path does not exist "${filepath}"`)
return null return null
} }
@ -79,7 +79,7 @@ async function parse(ebookFile) {
}) })
let metadata = null 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) { if (comicInfo) {
const comicInfoEntry = await comicInfo.file.extract() const comicInfoEntry = await comicInfo.file.extract()
if (comicInfoEntry?.fileData) { if (comicInfoEntry?.fileData) {
@ -97,7 +97,7 @@ async function parse(ebookFile) {
metadata 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) { if (firstImage?.file?._path) {
payload.ebookCoverPath = firstImage.file._path payload.ebookCoverPath = firstImage.file._path
} else { } else {