From c7356a977d866d2c1a798aca63ec9c0f8fea953c Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 26 Jan 2020 19:39:01 -0800 Subject: [PATCH] update title on metadata refresh putting this in a try block since sources have late inits for titles, just not as mangaimpl --- .../tachiyomi/data/database/models/MangaImpl.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 0e6d0efb57..273fd30c6e 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 @@ -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) }