Use SQLDelight on Updates screen (#7423)

This commit is contained in:
Andreas
2022-07-01 04:18:12 +02:00
committed by GitHub
parent b9e108eb4d
commit 1f10b79ee8
9 changed files with 156 additions and 125 deletions
@@ -2,16 +2,14 @@ package eu.kanade.tachiyomi.ui.manga.chapter.base
import eu.davidea.flexibleadapter.items.AbstractHeaderItem
import eu.davidea.flexibleadapter.items.AbstractSectionableItem
import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.domain.chapter.model.Chapter
import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.source.model.Page
abstract class BaseChapterItem<T : BaseChapterHolder, H : AbstractHeaderItem<*>>(
val chapter: Chapter,
header: H? = null,
) :
AbstractSectionableItem<T, H?>(header),
Chapter by chapter {
) : AbstractSectionableItem<T, H?>(header) {
private var _status: Download.State = Download.State.NOT_DOWNLOADED
@@ -36,12 +34,14 @@ abstract class BaseChapterItem<T : BaseChapterHolder, H : AbstractHeaderItem<*>>
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other is BaseChapterItem<*, *>) {
return chapter.id!! == other.chapter.id!!
return chapter.id == other.chapter.id && chapter.read == other.chapter.read
}
return false
}
override fun hashCode(): Int {
return chapter.id!!.hashCode()
var result = chapter.id.hashCode()
result = 31 * result + chapter.read.hashCode()
return result
}
}