mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-09-01 08:15:15 +02:00
Add:Server setting to disable folder watcher #378
This commit is contained in:
parent
1a89b6e493
commit
7f1fc1901b
4 changed files with 47 additions and 58 deletions
|
@ -13,6 +13,8 @@ class FolderWatcher extends EventEmitter {
|
|||
this.pendingFileUpdates = []
|
||||
this.pendingDelay = 4000
|
||||
this.pendingTimeout = null
|
||||
|
||||
this.disabled = false
|
||||
}
|
||||
|
||||
get pendingFilePaths() {
|
||||
|
@ -71,10 +73,12 @@ class FolderWatcher extends EventEmitter {
|
|||
}
|
||||
|
||||
addLibrary(library) {
|
||||
if (this.disabled) return
|
||||
this.buildLibraryWatcher(library)
|
||||
}
|
||||
|
||||
updateLibrary(library) {
|
||||
if (this.disabled) return
|
||||
var libwatcher = this.libraryWatchers.find(lib => lib.id === library.id)
|
||||
if (libwatcher) {
|
||||
libwatcher.name = library.name
|
||||
|
@ -90,6 +94,7 @@ class FolderWatcher extends EventEmitter {
|
|||
}
|
||||
|
||||
removeLibrary(library) {
|
||||
if (this.disabled) return
|
||||
var libwatcher = this.libraryWatchers.find(lib => lib.id === library.id)
|
||||
if (libwatcher) {
|
||||
Logger.info(`[Watcher] Removed watcher for "${library.name}"`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue