mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-27 04:17:57 +01:00
Fix cover fetching in compose views (#7315)
Make sure it passed thru the custom fetcher
This commit is contained in:
29
app/src/main/sqldelight/migrations/17.sqm
Normal file
29
app/src/main/sqldelight/migrations/17.sqm
Normal file
@@ -0,0 +1,29 @@
|
||||
DROP VIEW IF EXISTS historyView;
|
||||
|
||||
CREATE VIEW historyView AS
|
||||
SELECT
|
||||
history._id AS id,
|
||||
mangas._id AS mangaId,
|
||||
chapters._id AS chapterId,
|
||||
mangas.title,
|
||||
mangas.thumbnail_url AS thumbnailUrl,
|
||||
mangas.source,
|
||||
mangas.favorite,
|
||||
mangas.cover_last_modified,
|
||||
chapters.chapter_number AS chapterNumber,
|
||||
history.last_read AS readAt,
|
||||
history.time_read AS readDuration,
|
||||
max_last_read.last_read AS maxReadAt,
|
||||
max_last_read.chapter_id AS maxReadAtChapterId
|
||||
FROM mangas
|
||||
JOIN chapters
|
||||
ON mangas._id = chapters.manga_id
|
||||
JOIN history
|
||||
ON chapters._id = history.chapter_id
|
||||
JOIN (
|
||||
SELECT chapters.manga_id,chapters._id AS chapter_id, MAX(history.last_read) AS last_read
|
||||
FROM chapters JOIN history
|
||||
ON chapters._id = history.chapter_id
|
||||
GROUP BY chapters.manga_id
|
||||
) AS max_last_read
|
||||
ON chapters.manga_id = max_last_read.manga_id;
|
||||
@@ -5,6 +5,9 @@ SELECT
|
||||
chapters._id AS chapterId,
|
||||
mangas.title,
|
||||
mangas.thumbnail_url AS thumbnailUrl,
|
||||
mangas.source,
|
||||
mangas.favorite,
|
||||
mangas.cover_last_modified,
|
||||
chapters.chapter_number AS chapterNumber,
|
||||
history.last_read AS readAt,
|
||||
history.time_read AS readDuration,
|
||||
@@ -37,6 +40,9 @@ mangaId,
|
||||
chapterId,
|
||||
title,
|
||||
thumbnailUrl,
|
||||
source,
|
||||
favorite,
|
||||
cover_last_modified,
|
||||
chapterNumber,
|
||||
readAt,
|
||||
readDuration
|
||||
@@ -54,6 +60,9 @@ mangaId,
|
||||
chapterId,
|
||||
title,
|
||||
thumbnailUrl,
|
||||
source,
|
||||
favorite,
|
||||
cover_last_modified,
|
||||
chapterNumber,
|
||||
readAt,
|
||||
readDuration
|
||||
|
||||
Reference in New Issue
Block a user