File tree 2 files changed +10
-2
lines changed
server/src/main/kotlin/suwayomi/tachidesk/manga
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,19 @@ object CategoryManga {
70
70
.slice(ChapterTable .id.count())
71
71
.select { (MangaTable .id eq ChapterTable .manga) and (ChapterTable .isDownloaded eq true ) }
72
72
)
73
+ val chapterCountExpression = wrapAsExpression<Long >(
74
+ ChapterTable
75
+ .slice(ChapterTable .id.count())
76
+ .select { (MangaTable .id eq ChapterTable .manga) }
77
+ )
73
78
74
- val selectedColumns = MangaTable .columns + unreadExpression + downloadExpression
79
+ val selectedColumns = MangaTable .columns + unreadExpression + downloadExpression + chapterCountExpression
80
+
75
81
val transform: (ResultRow ) -> MangaDataClass = {
76
82
val dataClass = MangaTable .toDataClass(it)
77
83
dataClass.unreadCount = it[unreadExpression]?.toInt()
78
84
dataClass.downloadCount = it[downloadExpression]?.toInt()
85
+ dataClass.chapterCount = it[chapterCountExpression]?.toInt()
79
86
dataClass
80
87
}
81
88
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ data class MangaDataClass(
36
36
37
37
val freshData : Boolean = false ,
38
38
var unreadCount : Int? = null ,
39
- var downloadCount : Int? = null
39
+ var downloadCount : Int? = null ,
40
+ var chapterCount : Int? = null
40
41
)
41
42
42
43
data class PagedMangaListDataClass (
You can’t perform that action at this time.
0 commit comments