mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-06 10:42:44 +02:00
Clean up ApiRouter adding MiscController, move upload and scan to api endpoints
This commit is contained in:
@@ -109,17 +109,13 @@ class Scanner {
|
||||
return ScanResult.UPTODATE
|
||||
}
|
||||
|
||||
async scan(libraryId, options = {}) {
|
||||
if (this.isLibraryScanning(libraryId)) {
|
||||
Logger.error(`[Scanner] Already scanning ${libraryId}`)
|
||||
async scan(library, options = {}) {
|
||||
if (this.isLibraryScanning(library.id)) {
|
||||
Logger.error(`[Scanner] Already scanning ${library.id}`)
|
||||
return
|
||||
}
|
||||
|
||||
var library = this.db.libraries.find(lib => lib.id === libraryId)
|
||||
if (!library) {
|
||||
Logger.error(`[Scanner] Library not found for scan ${libraryId}`)
|
||||
return
|
||||
} else if (!library.folders.length) {
|
||||
if (!library.folders.length) {
|
||||
Logger.warn(`[Scanner] Library has no folders to scan "${library.name}"`)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user