mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-19 00:18:56 +01:00
Fix:Cancel library scan
This commit is contained in:
parent
4be004290d
commit
24d2e09724
@ -334,7 +334,7 @@ class Server {
|
|||||||
|
|
||||||
cancelScan(id) {
|
cancelScan(id) {
|
||||||
Logger.debug('[Server] Cancel scan', id)
|
Logger.debug('[Server] Cancel scan', id)
|
||||||
this.scanner2.cancelLibraryScan[id] = true
|
this.scanner2.setCancelLibraryScan(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generates an NFO metadata file, if no audiobookId is passed then all audiobooks are done
|
// Generates an NFO metadata file, if no audiobookId is passed then all audiobooks are done
|
||||||
|
@ -26,7 +26,6 @@ class Scanner {
|
|||||||
this.coverController = coverController
|
this.coverController = coverController
|
||||||
this.emitter = emitter
|
this.emitter = emitter
|
||||||
|
|
||||||
this.cancelScan = false
|
|
||||||
this.cancelLibraryScan = {}
|
this.cancelLibraryScan = {}
|
||||||
this.librariesScanning = []
|
this.librariesScanning = []
|
||||||
|
|
||||||
@ -51,6 +50,12 @@ class Scanner {
|
|||||||
return this.librariesScanning.find(ls => ls.id === libraryId)
|
return this.librariesScanning.find(ls => ls.id === libraryId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCancelLibraryScan(libraryId) {
|
||||||
|
var libraryScanning = this.librariesScanning.find(ls => ls.id === libraryId)
|
||||||
|
if (!libraryScanning) return
|
||||||
|
this.cancelLibraryScan[libraryId] = true
|
||||||
|
}
|
||||||
|
|
||||||
async scanAudiobookById(audiobookId) {
|
async scanAudiobookById(audiobookId) {
|
||||||
var audiobook = this.db.audiobooks.find(ab => ab.id === audiobookId)
|
var audiobook = this.db.audiobooks.find(ab => ab.id === audiobookId)
|
||||||
if (!audiobook) {
|
if (!audiobook) {
|
||||||
|
Loading…
Reference in New Issue
Block a user