From 157057b71bf2aefdf2df106f9bf53733224ae507 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 16 Jul 2021 14:12:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=B0=81?= =?UTF-8?q?=E9=9D=A2api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/api/ReaderProvider.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/api/ReaderProvider.kt b/app/src/main/java/io/legado/app/api/ReaderProvider.kt index 27110af24..cc054f9c4 100644 --- a/app/src/main/java/io/legado/app/api/ReaderProvider.kt +++ b/app/src/main/java/io/legado/app/api/ReaderProvider.kt @@ -20,7 +20,7 @@ import java.util.* class ReaderProvider : ContentProvider() { private enum class RequestCode { SaveSource, SaveSources, SaveBook, DeleteSources, GetSource, GetSources, - GetBookshelf, RefreshToc, GetChapterList, GetBookContent + GetBookshelf, RefreshToc, GetChapterList, GetBookContent, GetBookCover } private val postBodyKey = "json" @@ -37,6 +37,7 @@ class ReaderProvider : ContentProvider() { addURI(authority, "book/refreshToc/query", RequestCode.RefreshToc.ordinal) addURI(authority, "book/chapter/query", RequestCode.GetChapterList.ordinal) addURI(authority, "book/content/query", RequestCode.GetBookContent.ordinal) + addURI(authority, "book/cover/query", RequestCode.GetBookCover.ordinal) } } } @@ -90,6 +91,9 @@ class ReaderProvider : ContentProvider() { uri.getQueryParameter("index")?.let { map["index"] = arrayListOf(it) } + uri.getQueryParameter("path")?.let { + map["path"] = arrayListOf(it) + } return if (sMatcher.match(uri) < 0) null else when (RequestCode.values()[sMatcher.match(uri)]) { RequestCode.GetSource -> SimpleCursor(SourceController.getSource(map)) RequestCode.GetSources -> SimpleCursor(SourceController.sources) @@ -97,6 +101,7 @@ class ReaderProvider : ContentProvider() { RequestCode.GetBookContent -> SimpleCursor(BookController.getBookContent(map)) RequestCode.RefreshToc -> SimpleCursor(BookController.refreshToc(map)) RequestCode.GetChapterList -> SimpleCursor(BookController.getChapterList(map)) + RequestCode.GetBookCover -> SimpleCursor(BookController.getCover(map)) else -> throw IllegalStateException( "Unexpected value: " + RequestCode.values()[sMatcher.match(uri)].name )