From 491915aa22435d5c335426aa192afd9e7f8bd29b Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Thu, 6 May 2021 17:56:00 -0400 Subject: [PATCH] Fix same ids issue in library --- .../java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt | 2 +- .../main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt index 82abc8b546..5fff77c0ba 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt @@ -54,6 +54,6 @@ class LibraryHeaderItem( } override fun hashCode(): Int { - return -(category.id!!) + return (category.id ?: 0L).hashCode() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt index 4e167632bb..3f0bdafc83 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt @@ -181,6 +181,8 @@ class LibraryItem( } override fun hashCode(): Int { - return (manga.id!! + (manga.category shl 50).toLong()).hashCode() // !!.hashCode() + var result = manga.id!!.hashCode() + result = 31 * result + (header?.hashCode() ?: 0) + return result } }