mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore: Prepare find duplicate query
This commit is contained in:
parent
395f10c8a9
commit
535fcc81dd
2 changed files with 15 additions and 0 deletions
|
@ -139,6 +139,16 @@ fun Manga.addOrRemoveToFavorites(
|
||||||
): Snackbar? {
|
): Snackbar? {
|
||||||
if (!favorite) {
|
if (!favorite) {
|
||||||
if (checkForDupes) {
|
if (checkForDupes) {
|
||||||
|
// TODO
|
||||||
|
/*
|
||||||
|
val duplicateManga = runBlocking(Dispatchers.IO) { handler.awaitOne {
|
||||||
|
mangasQueries.findDuplicateFavorite(
|
||||||
|
this@addOrRemoveToFavorites.title,
|
||||||
|
this@addOrRemoveToFavorites.source,
|
||||||
|
Manga::mapper,
|
||||||
|
)
|
||||||
|
} }
|
||||||
|
*/
|
||||||
val duplicateManga = db.getDuplicateLibraryManga(this).executeAsBlocking()
|
val duplicateManga = db.getDuplicateLibraryManga(this).executeAsBlocking()
|
||||||
if (duplicateManga != null) {
|
if (duplicateManga != null) {
|
||||||
showAddDuplicateDialog(
|
showAddDuplicateDialog(
|
||||||
|
|
|
@ -40,6 +40,11 @@ SELECT *
|
||||||
FROM mangas
|
FROM mangas
|
||||||
WHERE _id = :mangaId;
|
WHERE _id = :mangaId;
|
||||||
|
|
||||||
|
findDuplicateFavorite:
|
||||||
|
SELECT *
|
||||||
|
FROM mangas
|
||||||
|
WHERE favorite = 1 AND lower(title) = :title AND source = :source;
|
||||||
|
|
||||||
insert:
|
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)
|
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)
|
||||||
VALUES (:source, :url, :artist, :author, :description, :genre, :title, :status, :thumbnailUrl, :favorite, :lastUpdate, :initialized, :viewer, :hideTitle, :chapterFlags, :dateAdded, :filteredScanlators, :updateStrategy);
|
VALUES (:source, :url, :artist, :author, :description, :genre, :title, :status, :thumbnailUrl, :favorite, :lastUpdate, :initialized, :viewer, :hideTitle, :chapterFlags, :dateAdded, :filteredScanlators, :updateStrategy);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue