From db3b67567c0db722a3933d45d106900b29f1c262 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Mon, 12 Jul 2021 15:23:27 +0800 Subject: [PATCH] Update BookChapter.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正 --- .../main/java/io/legado/app/data/entities/BookChapter.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/entities/BookChapter.kt b/app/src/main/java/io/legado/app/data/entities/BookChapter.kt index d4d6c13fc..0cb7342fe 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookChapter.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookChapter.kt @@ -61,11 +61,9 @@ data class BookChapter( } fun getAbsoluteURL():String{ - val pos = url.indexOf(',') - return if (pos == -1) NetworkUtils.getAbsoluteURL(baseUrl,url) - else NetworkUtils.getAbsoluteURL(baseUrl,url.substring(0,pos))+","+url.substring(pos + 1) + return url.replace("^\\s*([^,\\s]+)".toRex(),NetworkUtils.getAbsoluteURL(baseUrl,"$1")) } - + fun getFileName(): String = String.format("%05d-%s.nb", index, MD5Utils.md5Encode16(title)) fun getFontName(): String = String.format("%05d-%s.ttf", index, MD5Utils.md5Encode16(title))