Fix:metadata covers check file exists on scan #239

This commit is contained in:
advplyr 2021-12-15 19:39:26 -06:00
parent 91018e3c9b
commit 394789d64e

View File

@ -654,9 +654,9 @@ class Audiobook {
Logger.debug(`[Audiobook] Metadata cover full path set "${this.book.coverFullPath}" for "${this.title}"`)
hasUpdates = true
}
var coverStillExists = imageFiles.find(f => comparePaths(f.fullPath, this.book.coverFullPath))
if (!coverStillExists) {
Logger.info(`[Audiobook] Metadata cover "${this.book.cover}" was removed | "${this.title}"`)
// metadata covers are stored in /<MetadataPath>/books/:id/
if (!await fs.pathExists(this.book.coverFullPath)) {
Logger.info(`[Audiobook] Cover in /metadata for "${this.title}" no longer exists - removing cover paths`)
this.book.removeCover()
hasUpdates = true
}