Avoid showing duplicate entry dialog for same entry

Fixes #9772
This commit is contained in:
arkon
2023-07-29 12:07:13 -04:00
parent 3ad4f1114a
commit fd30c0adcd
6 changed files with 9 additions and 9 deletions

View File

@@ -321,7 +321,7 @@ class BrowseSourceScreenModel(
}
suspend fun getDuplicateLibraryManga(manga: Manga): Manga? {
return getDuplicateLibraryManga.await(manga.title)
return getDuplicateLibraryManga.await(manga).getOrNull(0)
}
private fun moveMangaToCategories(manga: Manga, vararg categories: Category) {

View File

@@ -284,7 +284,7 @@ class MangaScreenModel(
// Add to library
// First, check if duplicate exists if callback is provided
if (checkDuplicate) {
val duplicate = getDuplicateLibraryManga.await(manga.title)
val duplicate = getDuplicateLibraryManga.await(manga).getOrNull(0)
if (duplicate != null) {
updateSuccessState { it.copy(dialog = Dialog.DuplicateManga(manga, duplicate)) }