From f2b2767a23bbe7b5dbb866c7fdf90ed9cd176090 Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Thu, 15 Aug 2024 14:05:36 +0700 Subject: [PATCH] fix(library): Entry list should be unique --- CHANGELOG.md | 71 +------------------ .../tachiyomi/ui/library/LibraryPresenter.kt | 10 +-- 2 files changed, 6 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f3707ed6..d3c826fff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,74 +9,5 @@ ## Other ?? Technical stuff, what happened behind the scene --> -## Additions -- Add missing "Max automatic backups" option on experimental Data and Storage setting menu -- Add information on when was the last time backup automatically created to experimental Data and Storage setting menu -- Add monochrome icon - -## Changes -- Add more info to WorkerInfo page - - Added "next scheduled run" - - Added attempt count -- `english` tag no longer cause reading mode to switch to LTR (@mangkoran) -- `chinese` tag no longer cause reading mode to switch to LTR -- `manhua` tag no longer cause reading mode to switch to LTR -- Local source manga's cover now being invalidated on refresh -- It is now possible to create a backup without any entries using experimental Data and Storage setting menu -- Increased default maximum automatic backup files to 5 -- It is now possible to edit a local source entry without adding it to library -- Long Strip and Continuous Vertical background color now respect user setting -- Display Color Profile setting no longer limited to Android 8 or newer -- Increased long strip cache size to 4 for Android 8 or newer (@FooIbar) -- Use Coil pipeline to handle HEIF images - ## Fixes -- Fixed auto backup, auto extension update, and app update checker stop working - if it crash/failed -- Fixed crashes when trying to reload extension repo due to connection issue -- Fixed tap controls not working properly after zoom (@arkon, @Paloys, @FooIbar) -- Fixed (sorta, more like workaround) ANR issues when running background tasks, such as updating extensions (@ivaniskandar) -- Fixed split (downloaded) tall images sometimes doesn't work -- Fixed status bar stuck in dark mode when app is following system theme -- Fixed splash screen state only getting updates if library is empty (Should slightly reduce splash screen duration) -- Fixed kitsu tracker issue due to domain change -- Fixed entry custom cover won't load if entry doesn't have cover from source -- Fixed unread badge doesn't work properly for some sources (notably Komga) -- Fixed MAL start date parsing (@MajorTanya) - -## Translation -- Update Japanese translation (@akir45) -- Update Brazilian Portuguese translation (@AshbornXS) -- Update Filipino translation (@infyProductions) - -## Other -- Re-added several social media links to Mihon -- Some code refactors - - Simplify some messy code - - Rewrite version checker - - Rewrite Migrator (@ghostbear) - - Split the project into several modules - - Migrated i18n to use Moko Resources - - Removed unnecessary dependencies (@null2264, @nonproto) -- Update firebase bom to v33.1.0 -- Replace com.google.android.gms:play-services-oss-licenses with com.mikepenz:aboutlibraries -- Update dependency com.google.gms:google-services to v4.4.2 -- Add crashlytics integration for Kermit -- Replace ProgressBar with ProgressIndicator from Material3 to improve UI consistency -- More StorIO to SQLDelight migrations - - Merge lastFetch and lastRead query into library_view VIEW - - Migrated a few more chapter related queries - - Migrated most of the manga related queries -- Bump dependency com.github.tachiyomiorg:unifile revision to a9de196cc7 -- Update project to Kotlin 2.0 (v2.0.10) -- Update compose bom to v2024.08.00-alpha01 -- Refactor archive support to use `libarchive` (@FooIbar) -- Use version catalog for gradle plugins -- Update dependency org.jsoup:jsoup to v1.7.1 -- Bump dependency com.github.tachiyomiorg:image-decoder revision to 41c059e540 -- Update dependency io.coil-kt.coil3 to v3.0.0-alpha10 -- Update Android Gradle Plugin to v8.5.2 -- Update gradle to v8.9 -- Start using Voyager for navigation -- Update dependency androidx.work:work-runtime-ktx to v2.9.1 -- Update dependency androidx.annotation:annotation to v1.8.2 +- Fixed library showing duplicate entry when using dynamic category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 1fbc7c3203..b78871b8cc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -49,6 +49,10 @@ import eu.kanade.tachiyomi.util.system.launchNonCancellableIO import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.system.withIOContext import eu.kanade.tachiyomi.util.system.withUIContext +import java.util.* +import java.util.concurrent.* +import kotlin.math.roundToInt +import kotlin.random.Random import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.collectLatest @@ -71,10 +75,6 @@ import yokai.domain.manga.models.MangaUpdate import yokai.i18n.MR import yokai.util.isLewd import yokai.util.lang.getString -import java.util.* -import java.util.concurrent.* -import kotlin.math.roundToInt -import kotlin.random.Random /** * Typealias for the library manga, using the category as keys, and list of manga as values. @@ -1178,7 +1178,7 @@ class LibraryPresenter( } val unknown = context.getString(MR.strings.unknown) - val items = libraryManga.map { manga -> + val items = libraryManga.distinctBy { it.id }.map { manga -> when (groupType) { BY_TAG -> { val tags = if (manga.genre.isNullOrBlank()) {