Do not count mangas as part of categories that aren't in the library (#574)

Otherwise, the returned "size" of a property doesn't match the actual manga list, since that list only includes mangas from the library.
This commit is contained in:
schroda
2023-06-09 16:57:16 +02:00
committed by GitHub
parent 561d680e78
commit b59af683ac

View File

@@ -142,9 +142,8 @@ object Category {
.select { MangaTable.inLibrary eq true } .select { MangaTable.inLibrary eq true }
.andWhere { CategoryMangaTable.manga.isNull() } .andWhere { CategoryMangaTable.manga.isNull() }
} else { } else {
CategoryMangaTable.select { CategoryMangaTable.leftJoin(MangaTable).select { CategoryMangaTable.category eq categoryId }
CategoryMangaTable.category eq categoryId .andWhere { MangaTable.inLibrary eq true }
}
}.count().toInt() }.count().toInt()
} }
} }