From efa2af643bcdbff75efb08f26445aa69e53b11da Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Mon, 7 Jun 2021 14:02:12 +0800 Subject: [PATCH] Update Book.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 自定义简介有自动更新的需求时,可通过更新intro再调用upCustomIntro()完成 --- app/src/main/java/io/legado/app/data/entities/Book.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/data/entities/Book.kt b/app/src/main/java/io/legado/app/data/entities/Book.kt index 73b89205f..b51544110 100644 --- a/app/src/main/java/io/legado/app/data/entities/Book.kt +++ b/app/src/main/java/io/legado/app/data/entities/Book.kt @@ -113,6 +113,9 @@ data class Book( fun getDisplayIntro() = if (customIntro.isNullOrEmpty()) intro else customIntro + //自定义简介有自动更新的需求时,可通过更新intro再调用upCustomIntro()完成 + fun upCustomIntro() = customIntro = intro + fun fileCharset(): Charset { return charset(charset ?: "UTF-8") } @@ -269,4 +272,4 @@ data class Book( @TypeConverter fun stringToReadConfig(json: String?) = GSON.fromJsonObject(json) } -} \ No newline at end of file +}