mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-15 09:42:25 +02:00
Add LibrarySettings and update edit library modal to include settings tab
This commit is contained in:
34
server/objects/settings/LibrarySettings.js
Normal file
34
server/objects/settings/LibrarySettings.js
Normal file
@ -0,0 +1,34 @@
|
||||
const { BookCoverAspectRatio } = require('../../utils/constants')
|
||||
const Logger = require('../../Logger')
|
||||
|
||||
class LibrarySettings {
|
||||
constructor(settings) {
|
||||
this.disableWatcher = false
|
||||
|
||||
if (settings) {
|
||||
this.construct(settings)
|
||||
}
|
||||
}
|
||||
|
||||
construct(settings) {
|
||||
this.disableWatcher = !!settings.disableWatcher
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
disableWatcher: this.disableWatcher
|
||||
}
|
||||
}
|
||||
|
||||
update(payload) {
|
||||
var hasUpdates = false
|
||||
for (const key in payload) {
|
||||
if (this[key] !== payload[key]) {
|
||||
this[key] = payload[key]
|
||||
hasUpdates = true
|
||||
}
|
||||
}
|
||||
return hasUpdates
|
||||
}
|
||||
}
|
||||
module.exports = LibrarySettings
|
Reference in New Issue
Block a user