mirror of
https://github.com/gotson/komga.git
synced 2025-12-22 00:13:30 +01:00
fix: incorrect read progress for books
read progress for books would show incorrectly, leaking from other users closes #286
This commit is contained in:
parent
373ddd453f
commit
107d7db394
1 changed files with 3 additions and 6 deletions
|
|
@ -76,9 +76,8 @@ class BookDtoDao(
|
|||
.from(b)
|
||||
.leftJoin(m).on(b.ID.eq(m.BOOK_ID))
|
||||
.leftJoin(d).on(b.ID.eq(d.BOOK_ID))
|
||||
.leftJoin(r).on(b.ID.eq(r.BOOK_ID))
|
||||
.leftJoin(r).on(b.ID.eq(r.BOOK_ID)).and(readProgressCondition(userId))
|
||||
.leftJoin(bt).on(b.ID.eq(bt.BOOK_ID))
|
||||
.and(readProgressCondition(userId))
|
||||
.leftJoin(rlb).on(b.ID.eq(rlb.BOOK_ID))
|
||||
.where(conditions)
|
||||
.groupBy(b.ID)
|
||||
|
|
@ -119,8 +118,7 @@ class BookDtoDao(
|
|||
val seriesIds = dsl.select(s.ID)
|
||||
.from(s)
|
||||
.leftJoin(b).on(s.ID.eq(b.SERIES_ID))
|
||||
.leftJoin(r).on(b.ID.eq(r.BOOK_ID))
|
||||
.and(readProgressCondition(userId))
|
||||
.leftJoin(r).on(b.ID.eq(r.BOOK_ID)).and(readProgressCondition(userId))
|
||||
.where(conditions)
|
||||
.groupBy(s.ID)
|
||||
.having(SeriesDtoDao.countUnread.ge(inline(1.toBigDecimal())))
|
||||
|
|
@ -179,9 +177,8 @@ class BookDtoDao(
|
|||
.from(b)
|
||||
.leftJoin(m).on(b.ID.eq(m.BOOK_ID))
|
||||
.leftJoin(d).on(b.ID.eq(d.BOOK_ID))
|
||||
.leftJoin(r).on(b.ID.eq(r.BOOK_ID))
|
||||
.leftJoin(r).on(b.ID.eq(r.BOOK_ID)).and(readProgressCondition(userId))
|
||||
.leftJoin(bt).on(b.ID.eq(bt.BOOK_ID))
|
||||
.and(readProgressCondition(userId))
|
||||
.leftJoin(rlb).on(b.ID.eq(rlb.BOOK_ID))
|
||||
|
||||
private fun ResultQuery<Record>.fetchAndMap() =
|
||||
|
|
|
|||
Loading…
Reference in a new issue