coverPath bug fix on external rename

This commit is contained in:
yuuzhan 2023-02-21 12:51:24 -05:00
parent 8ccaec3d9f
commit f8def38321

View file

@ -402,14 +402,11 @@ 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) {
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) {
this.setLastScan()