Library Update Queries and Mutations (#609)

* Add library update GraphQL endpoints

* No need for data classes

* UpdateLibraryManga
This commit is contained in:
Mitchell Syer
2023-08-03 18:08:35 -04:00
committed by GitHub
parent 78a167aacf
commit c3fb08d634
11 changed files with 199 additions and 52 deletions

View File

@@ -68,11 +68,19 @@ object UpdateController {
val updater by DI.global.instance<IUpdater>()
if (categoryId == null) {
logger.info { "Adding Library to Update Queue" }
updater.addCategoriesToUpdateQueue(Category.getCategoryList(), true)
updater.addCategoriesToUpdateQueue(
Category.getCategoryList(),
clear = true,
forceAll = false
)
} else {
val category = Category.getCategoryById(categoryId)
if (category != null) {
updater.addCategoriesToUpdateQueue(listOf(category), true)
updater.addCategoriesToUpdateQueue(
listOf(category),
clear = true,
forceAll = true
)
} else {
logger.info { "No Category found" }
ctx.status(HttpCode.BAD_REQUEST)