mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
34 lines
664 B
JavaScript
34 lines
664 B
JavaScript
|
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
|