fix(api): library scan is always highest priority

This commit is contained in:
Gauthier Roebroeck 2021-12-22 10:13:59 +08:00
parent e628b7ea8f
commit e60acb86ff

View file

@ -1,5 +1,6 @@
package org.gotson.komga.interfaces.api.rest
import org.gotson.komga.application.tasks.HIGHEST_PRIORITY
import org.gotson.komga.application.tasks.HIGH_PRIORITY
import org.gotson.komga.application.tasks.TaskReceiver
import org.gotson.komga.domain.model.DirectoryNotFoundException
@ -161,7 +162,7 @@ class LibraryController(
@ResponseStatus(HttpStatus.ACCEPTED)
fun scan(@PathVariable libraryId: String) {
libraryRepository.findByIdOrNull(libraryId)?.let { library ->
taskReceiver.scanLibrary(library.id)
taskReceiver.scanLibrary(library.id, HIGHEST_PRIORITY)
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
}