mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +00:00
fix(recents): Can't open chapters from Grouped and All
id column name for mangas and chapter is both _id causing it conflict when doing 'Rn.*'. In fact, 'Rn.*' is not even needed for union, it just needs to be on the same order, same type, and have the same number of columns.
This commit is contained in:
parent
22978ab8bf
commit
d3c98fb897
3 changed files with 9 additions and 9 deletions
|
@ -11,6 +11,9 @@ The format is simplified version of [Keep a Changelog](https://keepachangelog.co
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixes
|
||||
- Fix chapters cannot be opened from `Recents > Grouped` and `Recents > All`
|
||||
|
||||
## [1.9.0]
|
||||
|
||||
### Additions
|
||||
|
|
|
@ -179,7 +179,7 @@ class RecentsPresenter(
|
|||
RecentsViewType.GroupedAll, RecentsViewType.UngroupedAll -> {
|
||||
getRecents.awaitAll(
|
||||
showRead,
|
||||
true,
|
||||
false,
|
||||
isEndless,
|
||||
!updatePageCount && !isOnFirstPage,
|
||||
query,
|
||||
|
@ -466,12 +466,14 @@ class RecentsPresenter(
|
|||
}
|
||||
|
||||
private suspend fun getNextChapter(manga: Manga): Chapter? {
|
||||
val chapters = getChapter.awaitAll(manga)
|
||||
val mangaId = manga.id ?: return null
|
||||
val chapters = getChapter.awaitAll(mangaId, true)
|
||||
return ChapterSort(manga, chapterFilter, preferences).getNextUnreadChapter(chapters, false)
|
||||
}
|
||||
|
||||
private suspend fun getFirstUpdatedChapter(manga: Manga, chapter: Chapter): Chapter? {
|
||||
val chapters = getChapter.awaitAll(manga)
|
||||
val mangaId = manga.id ?: return null
|
||||
val chapters = getChapter.awaitAll(mangaId, true)
|
||||
return chapters
|
||||
.sortedWith(ChapterSort(manga, chapterFilter, preferences).sortComparator(true)).find {
|
||||
!it.read && abs(it.date_fetch - chapter.date_fetch) <= TimeUnit.HOURS.toMillis(12)
|
||||
|
|
|
@ -110,7 +110,6 @@ ORDER BY max_last_read.history_last_read DESC
|
|||
LIMIT :limit OFFSET :offset;
|
||||
|
||||
getRecentsAll:
|
||||
SELECT R1.* FROM (
|
||||
SELECT
|
||||
M.*,
|
||||
C.*,
|
||||
|
@ -157,11 +156,9 @@ WHERE lower(title) LIKE '%' || :search || '%'
|
|||
AND (
|
||||
:apply_filter = 0 OR S.name IS NULL
|
||||
)
|
||||
) AS R1
|
||||
|
||||
UNION -- Newly added chapter
|
||||
|
||||
SELECT R2.* FROM (
|
||||
SELECT
|
||||
M.*,
|
||||
C.*,
|
||||
|
@ -194,11 +191,9 @@ AND lower(title) LIKE '%' || :search || '%'
|
|||
AND (
|
||||
:apply_filter = 0 OR S.name IS NULL
|
||||
)
|
||||
) AS R2
|
||||
|
||||
UNION -- Newly added manga
|
||||
|
||||
SELECT R3.* FROM (
|
||||
SELECT
|
||||
M.*,
|
||||
C.*,
|
||||
|
@ -225,6 +220,6 @@ JOIN (
|
|||
) AS C
|
||||
WHERE favorite = 1
|
||||
AND lower(title) LIKE '%' || :search || '%'
|
||||
) AS R3
|
||||
|
||||
ORDER BY history_last_read DESC
|
||||
LIMIT :limit OFFSET :offset;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue