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