mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-19 11:21:27 +02:00
Add:Server setting to disable folder watcher #378
This commit is contained in:
@@ -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}"`)
|
||||
|
Reference in New Issue
Block a user