mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-16 14:21:41 +00:00
coverPath bug fix on external rename
This commit is contained in:
parent
8ccaec3d9f
commit
f8def38321
1 changed files with 4 additions and 7 deletions
|
|
@ -402,14 +402,11 @@ class LibraryItem {
|
||||||
this.isInvalid = !this.media.hasMediaEntities
|
this.isInvalid = !this.media.hasMediaEntities
|
||||||
|
|
||||||
// If cover path is in item folder, make sure libraryFile exists for it
|
// If cover path is in item folder, make sure libraryFile exists for it
|
||||||
if (this.media.coverPath && this.media.coverPath.startsWith(this.path)) {
|
if (this.media.coverPath && fs.pathExistsSync(this.media.coverPath) == false) {
|
||||||
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}"`)
|
Logger.warn(`[LibraryItem] Invalid cover path - library file dne "${this.media.coverPath}"`)
|
||||||
this.media.updateCover('')
|
this.media.updateCover('')
|
||||||
hasUpdated = true
|
hasUpdated = true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (hasUpdated) {
|
if (hasUpdated) {
|
||||||
this.setLastScan()
|
this.setLastScan()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue