From f8def38321ee17c82b3c5566f6a3ef073b15c176 Mon Sep 17 00:00:00 2001 From: yuuzhan Date: Tue, 21 Feb 2023 12:51:24 -0500 Subject: [PATCH] coverPath bug fix on external rename --- server/objects/LibraryItem.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/objects/LibraryItem.js b/server/objects/LibraryItem.js index 956742881..cf9ca540f 100644 --- a/server/objects/LibraryItem.js +++ b/server/objects/LibraryItem.js @@ -402,13 +402,10 @@ class LibraryItem { this.isInvalid = !this.media.hasMediaEntities // If cover path is in item folder, make sure libraryFile exists for it - if (this.media.coverPath && this.media.coverPath.startsWith(this.path)) { - const lf = this.libraryFiles.find(lf => lf.metadata.path === this.media.coverPath) - if (!lf) { - Logger.warn(`[LibraryItem] Invalid cover path - library file dne "${this.media.coverPath}"`) - this.media.updateCover('') - hasUpdated = true - } + if (this.media.coverPath && fs.pathExistsSync(this.media.coverPath) == false) { + Logger.warn(`[LibraryItem] Invalid cover path - library file dne "${this.media.coverPath}"`) + this.media.updateCover('') + hasUpdated = true } if (hasUpdated) {