mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-27 11:19:30 +02:00
Fix:Save library updating name only #350
This commit is contained in:
parent
964cba0491
commit
663ab2db90
2 changed files with 8 additions and 3 deletions
|
@ -51,13 +51,15 @@ class LibraryController {
|
|||
|
||||
async update(req, res) {
|
||||
var library = req.library
|
||||
|
||||
var hasUpdates = library.update(req.body)
|
||||
// TODO: Should check if this is an update to folder paths or name only
|
||||
if (hasUpdates) {
|
||||
// Update watcher
|
||||
this.watcher.updateLibrary(library)
|
||||
|
||||
// Remove audiobooks no longer in library
|
||||
var audiobooksToRemove = this.db.audiobooks.filter(ab => !library.checkFullPathInLibrary(ab.fullPath))
|
||||
var audiobooksToRemove = this.db.audiobooks.filter(ab => ab.libraryId === library.id && !library.checkFullPathInLibrary(ab.fullPath))
|
||||
if (audiobooksToRemove.length) {
|
||||
Logger.info(`[Scanner] Updating library, removing ${audiobooksToRemove.length} audiobooks`)
|
||||
for (let i = 0; i < audiobooksToRemove.length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue