diff --git a/app/src/main/java/io/legado/app/data/entities/BookSource.kt b/app/src/main/java/io/legado/app/data/entities/BookSource.kt index aa47ad73c..45152370c 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookSource.kt @@ -190,6 +190,19 @@ data class BookSource( private fun equal(a: String?, b: String?) = a == b || (a.isNullOrEmpty() && b.isNullOrEmpty()) class Converters { + @TypeConverter + fun loginRuleTString(loginRule: LoginRule?): String = GSON.toJson(loginRule) + + @TypeConverter + fun stringToLoginRule(json: String?): LoginRule? { + json ?: return null + return if (json.isJsonObject()) { + GSON.fromJsonObject(json) + } else { + LoginRule(url = json) + } + } + @TypeConverter fun exploreRuleToString(exploreRule: ExploreRule?): String = GSON.toJson(exploreRule) diff --git a/app/src/main/java/io/legado/app/model/ReadBook.kt b/app/src/main/java/io/legado/app/model/ReadBook.kt index 041e75e8b..ad51bd6d6 100644 --- a/app/src/main/java/io/legado/app/model/ReadBook.kt +++ b/app/src/main/java/io/legado/app/model/ReadBook.kt @@ -217,7 +217,7 @@ object ReadBook { book?.let { book -> //最后一章时检查更新 if (durChapterPos == 0 && durChapterIndex == chapterSize - 1 && book.isOnLineTxt()) { - callBack?.loadChapterList(book) + } } }