New model update details, author and series inputs with create new, compare & copy utils

This commit is contained in:
advplyr 2022-03-11 19:46:32 -06:00
parent f2be3bc95e
commit 5f4e5cd3d8
19 changed files with 707 additions and 70 deletions

View file

@ -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