From 28808b86713ada2ca59cc7235898e2a007e4362b Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sun, 2 Oct 2022 15:30:32 +0800 Subject: [PATCH] fix(Book): isLocalBook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * book.origin以webDav开头时,isLocalBook此时应该返回true --- 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 d5ff08514..426913043 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 @@ -14,6 +14,7 @@ import io.legado.app.model.ReadBook import io.legado.app.utils.GSON import io.legado.app.utils.MD5Utils import io.legado.app.utils.fromJsonObject +import io.legado.app.utils.isUri import kotlinx.coroutines.runBlocking import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize @@ -108,7 +109,9 @@ data class Book( ) : Parcelable, BaseBook { fun isLocalBook(): Boolean { - return origin == BookType.local + //通过判断书籍链接来判断http* file:// content:// + //origin判断不可靠 http* BookType.local webDav:: + return origin == BookType.local || bookUrl.isUri() } fun isLocalTxt(): Boolean {