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:
Ahmad Ansori Palembani 2024-12-09 21:57:17 +07:00
parent 22978ab8bf
commit d3c98fb897
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
3 changed files with 9 additions and 9 deletions

View file

@ -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;