mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-09 23:27:34 +02:00
New model update details, author and series inputs with create new, compare & copy utils
This commit is contained in:
14
server/Db.js
14
server/Db.js
@ -184,6 +184,20 @@ class Db {
|
||||
}
|
||||
}
|
||||
|
||||
async updateLibraryItem(libraryItem) {
|
||||
if (libraryItem && libraryItem.saveMetadata) {
|
||||
await libraryItem.saveMetadata()
|
||||
}
|
||||
|
||||
return this.libraryItemsDb.update((record) => record.id === libraryItem.id, () => libraryItem).then((results) => {
|
||||
Logger.debug(`[DB] Library Item updated ${results.updated}`)
|
||||
return true
|
||||
}).catch((error) => {
|
||||
Logger.error(`[DB] Library Item update failed ${error}`)
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
async updateAudiobook(audiobook) {
|
||||
if (audiobook && audiobook.saveAbMetadata) {
|
||||
// TODO: Book may have updates where this save is not necessary
|
||||
|
Reference in New Issue
Block a user