Add LibrarySettings and update edit library modal to include settings tab

This commit is contained in:
advplyr 2022-04-14 17:15:52 -05:00
parent cbde451120
commit 5a26b01ffb
12 changed files with 356 additions and 162 deletions

View 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