refactor(backup): Retrieve manga with SQLDelight

This commit is contained in:
Ahmad Ansori Palembani 2024-10-13 19:09:15 +07:00
parent ad070fd59a
commit 9b45767667
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
5 changed files with 19 additions and 10 deletions

View file

@ -50,6 +50,13 @@ SELECT *
FROM mangas
WHERE favorite = 1;
findReadNotFavorites:
SELECT *
FROM mangas
WHERE favorite = 0 AND _id IN (
SELECT chapters.manga_id FROM chapters WHERE read = 1 OR last_page_read != 0
);
insert:
INSERT INTO mangas (source, url, artist, author, description, genre, title, status, thumbnail_url, favorite, last_update, initialized, viewer, hide_title, chapter_flags, date_added, filtered_scanlators, update_strategy, cover_last_modified)
VALUES (:source, :url, :artist, :author, :description, :genre, :title, :status, :thumbnailUrl, :favorite, :lastUpdate, :initialized, :viewer, :hideTitle, :chapterFlags, :dateAdded, :filteredScanlators, :updateStrategy, :coverLastModified);