mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-13 07:19:38 +00:00
Change: Bookmark UI #115
This commit is contained in:
parent
76f28971a9
commit
908b9da112
6 changed files with 115 additions and 95 deletions
10
server/Db.js
10
server/Db.js
|
|
@ -170,7 +170,15 @@ class Db {
|
|||
|
||||
updateEntity(entityName, entity) {
|
||||
var entityDb = this.getEntityDb(entityName)
|
||||
return entityDb.update((record) => record.id === entity.id, () => entity).then((results) => {
|
||||
|
||||
var jsonEntity = entity
|
||||
if (entity && entity.toJSON) {
|
||||
jsonEntity = entity.toJSON()
|
||||
} else {
|
||||
console.log('Entity has no json', jsonEntity)
|
||||
}
|
||||
|
||||
return entityDb.update((record) => record.id === entity.id, () => jsonEntity).then((results) => {
|
||||
Logger.debug(`[DB] Updated entity ${entityName}: ${results.updated}`)
|
||||
var arrayKey = this.getEntityArrayKey(entityName)
|
||||
this[arrayKey] = this[arrayKey].map(e => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue