mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-11 14:54:33 -05:00
Feature/updater provide more info about update (#657)
* Provide last global update timestamp * Provide skipped mangas in update status * Extract update status logic into function * Rename update "statusMap" to "mangaStatusMap" * Provide info about categories in update status
This commit is contained in:
@@ -36,6 +36,22 @@ class CategoryDataLoader : KotlinDataLoader<Int, CategoryType> {
|
||||
}
|
||||
}
|
||||
|
||||
class CategoryForIdsDataLoader : KotlinDataLoader<List<Int>, CategoryNodeList> {
|
||||
override val dataLoaderName = "CategoryForIdsDataLoader"
|
||||
override fun getDataLoader(): DataLoader<List<Int>, CategoryNodeList> = DataLoaderFactory.newDataLoader { categoryIds ->
|
||||
future {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val ids = categoryIds.flatten().distinct()
|
||||
val categories = CategoryTable.select { CategoryTable.id inList ids }.map { CategoryType(it) }
|
||||
categoryIds.map { categoryIds ->
|
||||
categories.filter { it.id in categoryIds }.toNodeList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class CategoriesForMangaDataLoader : KotlinDataLoader<Int, CategoryNodeList> {
|
||||
override val dataLoaderName = "CategoriesForMangaDataLoader"
|
||||
override fun getDataLoader(): DataLoader<Int, CategoryNodeList> = DataLoaderFactory.newDataLoader<Int, CategoryNodeList> { ids ->
|
||||
|
||||
Reference in New Issue
Block a user