From b0106aa4209317a5a2efd22a356d6aa75199c698 Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 27 Jul 2020 15:59:15 -0400 Subject: [PATCH] Fix getting stuck in chapter loop when chapters have identical URLs --- .../kanade/tachiyomi/data/database/models/CategoryImpl.kt | 1 - .../eu/kanade/tachiyomi/data/database/models/ChapterImpl.kt | 5 +++-- .../eu/kanade/tachiyomi/data/database/models/MangaImpl.kt | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/CategoryImpl.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/CategoryImpl.kt index 3e59a674e9..af40baecb8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/CategoryImpl.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/CategoryImpl.kt @@ -15,7 +15,6 @@ class CategoryImpl : Category { if (other == null || javaClass != other.javaClass) return false val category = other as Category - return name == category.name } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/ChapterImpl.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/ChapterImpl.kt index 167df2b056..a1a2d3f55e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/ChapterImpl.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/ChapterImpl.kt @@ -31,10 +31,11 @@ class ChapterImpl : Chapter { if (other == null || javaClass != other.javaClass) return false val chapter = other as Chapter - return url == chapter.url + if (url != chapter.url) return false + return id == chapter.id } override fun hashCode(): Int { - return url.hashCode() + return url.hashCode() + id.hashCode() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt index 32cc47309d..61d7879523 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt @@ -41,11 +41,11 @@ open class MangaImpl : Manga { if (other == null || javaClass != other.javaClass) return false val manga = other as Manga - - return url == manga.url + if (url != manga.url) return false + return id == manga.id } override fun hashCode(): Int { - return url.hashCode() + return url.hashCode() + id.hashCode() } }