update title on metadata refresh

putting this in a try block since sources have late inits for titles, just not as mangaimpl
This commit is contained in:
Jay 2020-01-26 19:39:01 -08:00
parent ff5169d7b9
commit c7356a977d

View File

@ -1,6 +1,7 @@
package eu.kanade.tachiyomi.data.database.models package eu.kanade.tachiyomi.data.database.models
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import java.lang.Exception
open class MangaImpl : Manga { open class MangaImpl : Manga {
@ -37,13 +38,16 @@ open class MangaImpl : Manga {
override var hide_title: Boolean = false override var hide_title: Boolean = false
override fun copyFrom(other: SManga) { override fun copyFrom(other: SManga) {
if ((other is MangaImpl && (other as MangaImpl)::title.isInitialized && other.title != title)) { try {
title = if (currentTitle() != originalTitle()) { if (other.title != title) {
val customTitle = currentTitle() title = if (currentTitle() != originalTitle()) {
val trueTitle = other.title val customTitle = currentTitle()
"${customTitle}${SManga.splitter}${trueTitle}" val trueTitle = other.title
} else other.title "${customTitle}${SManga.splitter}${trueTitle}"
} else other.title
}
} }
catch(e: Exception) { }
super.copyFrom(other) super.copyFrom(other)
} }