Optimize and cleanup library code (#2329)

This commit is contained in:
AntsyLich
2025-08-02 09:04:23 +06:00
committed by GitHub
parent 1365b28106
commit e62cd0e816
18 changed files with 370 additions and 338 deletions
@@ -7,9 +7,9 @@ SELECT
coalesce(C.fetchedAt, 0) AS chapterFetchedAt,
coalesce(C.lastRead, 0) AS lastRead,
coalesce(C.bookmarkCount, 0) AS bookmarkCount,
coalesce(MC.category_id, 0) AS category
coalesce(MC.categories, '0') AS categories
FROM mangas M
LEFT JOIN(
LEFT JOIN (
SELECT
chapters.manga_id,
count(*) AS total,
@@ -28,7 +28,11 @@ LEFT JOIN(
GROUP BY chapters.manga_id
) AS C
ON M._id = C.manga_id
LEFT JOIN mangas_categories AS MC
LEFT JOIN (
SELECT manga_id, group_concat(category_id) AS categories
FROM mangas_categories
GROUP BY manga_id
) AS MC
ON MC.manga_id = M._id
WHERE M.favorite = 1;