mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-08 21:34:34 -05:00
[skip ci] Formatting
This commit is contained in:
@@ -30,7 +30,8 @@ class CategoryDataLoader : KotlinDataLoader<Int, CategoryType> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val categories =
|
||||
CategoryTable.select { CategoryTable.id inList ids }
|
||||
CategoryTable
|
||||
.select { CategoryTable.id inList ids }
|
||||
.map { CategoryType(it) }
|
||||
.associateBy { it.id }
|
||||
ids.map { categories[it] }
|
||||
@@ -66,7 +67,8 @@ class CategoriesForMangaDataLoader : KotlinDataLoader<Int, CategoryNodeList> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val itemsByRef =
|
||||
CategoryMangaTable.innerJoin(CategoryTable)
|
||||
CategoryMangaTable
|
||||
.innerJoin(CategoryTable)
|
||||
.select { CategoryMangaTable.manga inList ids }
|
||||
.map { Pair(it[CategoryMangaTable.manga].value, CategoryType(it)) }
|
||||
.groupBy { it.first }
|
||||
|
||||
@@ -32,7 +32,8 @@ class ChapterDataLoader : KotlinDataLoader<Int, ChapterType?> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val chapters =
|
||||
ChapterTable.select { ChapterTable.id inList ids }
|
||||
ChapterTable
|
||||
.select { ChapterTable.id inList ids }
|
||||
.map { ChapterType(it) }
|
||||
.associateBy { it.id }
|
||||
ids.map { chapters[it] }
|
||||
@@ -50,7 +51,8 @@ class ChaptersForMangaDataLoader : KotlinDataLoader<Int, ChapterNodeList> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val chaptersByMangaId =
|
||||
ChapterTable.select { ChapterTable.manga inList ids }
|
||||
ChapterTable
|
||||
.select { ChapterTable.manga inList ids }
|
||||
.map { ChapterType(it) }
|
||||
.groupBy { it.mangaId }
|
||||
ids.map { (chaptersByMangaId[it] ?: emptyList()).toNodeList() }
|
||||
@@ -128,7 +130,8 @@ class HasDuplicateChaptersForMangaDataLoader : KotlinDataLoader<Int, Boolean> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val duplicatedChapterCountByMangaId =
|
||||
ChapterTable.slice(ChapterTable.manga, ChapterTable.chapter_number, ChapterTable.chapter_number.count())
|
||||
ChapterTable
|
||||
.slice(ChapterTable.manga, ChapterTable.chapter_number, ChapterTable.chapter_number.count())
|
||||
.select { (ChapterTable.manga inList ids) and (ChapterTable.chapter_number greaterEq 0f) }
|
||||
.groupBy(ChapterTable.manga, ChapterTable.chapter_number)
|
||||
.having { ChapterTable.chapter_number.count() greater 1 }
|
||||
|
||||
@@ -28,7 +28,8 @@ class ExtensionDataLoader : KotlinDataLoader<String, ExtensionType?> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val extensions =
|
||||
ExtensionTable.select { ExtensionTable.pkgName inList ids }
|
||||
ExtensionTable
|
||||
.select { ExtensionTable.pkgName inList ids }
|
||||
.map { ExtensionType(it) }
|
||||
.associateBy { it.pkgName }
|
||||
ids.map { extensions[it] }
|
||||
@@ -46,7 +47,8 @@ class ExtensionForSourceDataLoader : KotlinDataLoader<Long, ExtensionType?> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val extensions =
|
||||
ExtensionTable.innerJoin(SourceTable)
|
||||
ExtensionTable
|
||||
.innerJoin(SourceTable)
|
||||
.select { SourceTable.id inList ids }
|
||||
.toList()
|
||||
.map { Triple(it[SourceTable.id].value, it[ExtensionTable.pkgName], it) }
|
||||
|
||||
@@ -33,7 +33,8 @@ class MangaDataLoader : KotlinDataLoader<Int, MangaType?> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val manga =
|
||||
MangaTable.select { MangaTable.id inList ids }
|
||||
MangaTable
|
||||
.select { MangaTable.id inList ids }
|
||||
.map { MangaType(it) }
|
||||
.associateBy { it.id }
|
||||
ids.map { manga[it] }
|
||||
@@ -63,7 +64,8 @@ class MangaForCategoryDataLoader : KotlinDataLoader<Int, MangaNodeList> {
|
||||
} else {
|
||||
emptyMap()
|
||||
} +
|
||||
CategoryMangaTable.innerJoin(MangaTable)
|
||||
CategoryMangaTable
|
||||
.innerJoin(MangaTable)
|
||||
.select { CategoryMangaTable.category inList ids }
|
||||
.map { Pair(it[CategoryMangaTable.category].value, MangaType(it)) }
|
||||
.groupBy { it.first }
|
||||
@@ -84,7 +86,8 @@ class MangaForSourceDataLoader : KotlinDataLoader<Long, MangaNodeList> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val mangaBySourceId =
|
||||
MangaTable.select { MangaTable.sourceReference inList ids }
|
||||
MangaTable
|
||||
.select { MangaTable.sourceReference inList ids }
|
||||
.map { MangaType(it) }
|
||||
.groupBy { it.sourceId }
|
||||
ids.map { (mangaBySourceId[it] ?: emptyList()).toNodeList() }
|
||||
@@ -104,7 +107,8 @@ class MangaForIdsDataLoader : KotlinDataLoader<List<Int>, MangaNodeList> {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val ids = mangaIds.flatten().distinct()
|
||||
val manga =
|
||||
MangaTable.select { MangaTable.id inList ids }
|
||||
MangaTable
|
||||
.select { MangaTable.id inList ids }
|
||||
.map { MangaType(it) }
|
||||
mangaIds.map { mangaIds ->
|
||||
manga.filter { it.id in mangaIds }.toNodeList()
|
||||
|
||||
@@ -28,7 +28,8 @@ class GlobalMetaDataLoader : KotlinDataLoader<String, GlobalMetaType?> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val metasByRefId =
|
||||
GlobalMetaTable.select { GlobalMetaTable.key inList ids }
|
||||
GlobalMetaTable
|
||||
.select { GlobalMetaTable.key inList ids }
|
||||
.map { GlobalMetaType(it) }
|
||||
.associateBy { it.key }
|
||||
ids.map { metasByRefId[it] }
|
||||
@@ -46,7 +47,8 @@ class ChapterMetaDataLoader : KotlinDataLoader<Int, List<ChapterMetaType>> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val metasByRefId =
|
||||
ChapterMetaTable.select { ChapterMetaTable.ref inList ids }
|
||||
ChapterMetaTable
|
||||
.select { ChapterMetaTable.ref inList ids }
|
||||
.map { ChapterMetaType(it) }
|
||||
.groupBy { it.chapterId }
|
||||
ids.map { metasByRefId[it].orEmpty() }
|
||||
@@ -64,7 +66,8 @@ class MangaMetaDataLoader : KotlinDataLoader<Int, List<MangaMetaType>> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val metasByRefId =
|
||||
MangaMetaTable.select { MangaMetaTable.ref inList ids }
|
||||
MangaMetaTable
|
||||
.select { MangaMetaTable.ref inList ids }
|
||||
.map { MangaMetaType(it) }
|
||||
.groupBy { it.mangaId }
|
||||
ids.map { metasByRefId[it].orEmpty() }
|
||||
@@ -82,7 +85,8 @@ class CategoryMetaDataLoader : KotlinDataLoader<Int, List<CategoryMetaType>> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val metasByRefId =
|
||||
CategoryMetaTable.select { CategoryMetaTable.ref inList ids }
|
||||
CategoryMetaTable
|
||||
.select { CategoryMetaTable.ref inList ids }
|
||||
.map { CategoryMetaType(it) }
|
||||
.groupBy { it.categoryId }
|
||||
ids.map { metasByRefId[it].orEmpty() }
|
||||
@@ -100,7 +104,8 @@ class SourceMetaDataLoader : KotlinDataLoader<Long, List<SourceMetaType>> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val metasByRefId =
|
||||
SourceMetaTable.select { SourceMetaTable.ref inList ids }
|
||||
SourceMetaTable
|
||||
.select { SourceMetaTable.ref inList ids }
|
||||
.map { SourceMetaType(it) }
|
||||
.groupBy { it.sourceId }
|
||||
ids.map { metasByRefId[it].orEmpty() }
|
||||
|
||||
@@ -30,7 +30,8 @@ class SourceDataLoader : KotlinDataLoader<Long, SourceType?> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val source =
|
||||
SourceTable.select { SourceTable.id inList ids }
|
||||
SourceTable
|
||||
.select { SourceTable.id inList ids }
|
||||
.mapNotNull { SourceType(it) }
|
||||
.associateBy { it.id }
|
||||
ids.map { source[it] }
|
||||
@@ -49,7 +50,8 @@ class SourcesForExtensionDataLoader : KotlinDataLoader<String, SourceNodeList> {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
|
||||
val sourcesByExtensionPkg =
|
||||
SourceTable.innerJoin(ExtensionTable)
|
||||
SourceTable
|
||||
.innerJoin(ExtensionTable)
|
||||
.select { ExtensionTable.pkgName inList ids }
|
||||
.map { Pair(it[ExtensionTable.pkgName], SourceType(it)) }
|
||||
.groupBy { it.first }
|
||||
|
||||
@@ -89,7 +89,8 @@ class TrackRecordsForMangaIdDataLoader : KotlinDataLoader<Int, TrackRecordNodeLi
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val trackRecordsByMangaId =
|
||||
TrackRecordTable.select { TrackRecordTable.mangaId inList ids }
|
||||
TrackRecordTable
|
||||
.select { TrackRecordTable.mangaId inList ids }
|
||||
.map { TrackRecordType(it) }
|
||||
.groupBy { it.mangaId }
|
||||
ids.map { (trackRecordsByMangaId[it] ?: emptyList()).toNodeList() }
|
||||
@@ -107,7 +108,8 @@ class DisplayScoreForTrackRecordDataLoader : KotlinDataLoader<Int, String> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val trackRecords =
|
||||
TrackRecordTable.select { TrackRecordTable.id inList ids }
|
||||
TrackRecordTable
|
||||
.select { TrackRecordTable.id inList ids }
|
||||
.toList()
|
||||
.map { it.toTrack() }
|
||||
.associateBy { it.id!! }
|
||||
@@ -128,7 +130,8 @@ class TrackRecordsForTrackerIdDataLoader : KotlinDataLoader<Int, TrackRecordNode
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val trackRecordsBySyncId =
|
||||
TrackRecordTable.select { TrackRecordTable.trackerId inList ids }
|
||||
TrackRecordTable
|
||||
.select { TrackRecordTable.trackerId inList ids }
|
||||
.map { TrackRecordType(it) }
|
||||
.groupBy { it.mangaId }
|
||||
ids.map { (trackRecordsBySyncId[it] ?: emptyList()).toNodeList() }
|
||||
@@ -146,7 +149,8 @@ class TrackRecordDataLoader : KotlinDataLoader<Int, TrackRecordType> {
|
||||
transaction {
|
||||
addLogger(Slf4jSqlDebugLogger)
|
||||
val trackRecordsId =
|
||||
TrackRecordTable.select { TrackRecordTable.id inList ids }
|
||||
TrackRecordTable
|
||||
.select { TrackRecordTable.id inList ids }
|
||||
.map { TrackRecordType(it) }
|
||||
.associateBy { it.id }
|
||||
ids.map { trackRecordsId[it] }
|
||||
|
||||
Reference in New Issue
Block a user