mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-03 19:07:00 -05: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 |