From 6ecb62177be749bc3744ab81160471baff0a195e Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sun, 10 Apr 2022 20:45:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=AE=A2=E9=98=85=E6=BA=90=E5=B0=81?= =?UTF-8?q?=E9=9D=A2,icon=E7=9A=84=E7=BC=BA=E7=9C=81headers=E7=9A=84?= =?UTF-8?q?=E4=BC=98=E5=85=88=E7=BA=A7:=E4=B9=A6=E6=BA=90>=E5=85=A8?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/glide/ImageLoader.kt | 4 +++- app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt | 2 +- .../java/io/legado/app/ui/rss/article/RssArticlesAdapter.kt | 2 +- .../java/io/legado/app/ui/rss/article/RssArticlesAdapter1.kt | 2 +- .../java/io/legado/app/ui/rss/article/RssArticlesAdapter2.kt | 2 +- .../io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt b/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt index ea4163da4..b60131995 100644 --- a/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt +++ b/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt @@ -28,7 +28,9 @@ object ImageLoader { } path.isAbsUrl() -> { kotlin.runCatching { - val source = sourceOrigin?.let { appDb.bookSourceDao.getBookSource(it) } + val source = sourceOrigin?.let { + appDb.bookSourceDao.getBookSource(it) ?: appDb.rssSourceDao.getByKey(it) + } val url = AnalyzeUrl(path, source = source).getGlideUrl() GlideApp.with(context).load(url) }.getOrDefault( diff --git a/app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt b/app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt index b3df28b0d..0fa56a4a4 100644 --- a/app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt @@ -27,7 +27,7 @@ class RssAdapter(context: Context, val callBack: CallBack) : ) { binding.apply { tvName.text = item.sourceName - ImageLoader.load(context, item.sourceIcon) + ImageLoader.load(context, item.sourceIcon, item.sourceUrl) .centerCrop() .placeholder(R.drawable.image_rss) .error(R.drawable.image_rss) diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter.kt index b2d14e9f1..85c39d029 100644 --- a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter.kt @@ -38,7 +38,7 @@ class RssArticlesAdapter(context: Context, callBack: CallBack) : if (item.image.isNullOrBlank() && !callBack.isGridLayout) { imageView.gone() } else { - ImageLoader.load(context, item.image).apply { + ImageLoader.load(context, item.image, item.origin).apply { if (callBack.isGridLayout) { placeholder(R.drawable.image_rss_article) } else { diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter1.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter1.kt index d92fb4b94..40a53984d 100644 --- a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter1.kt +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter1.kt @@ -36,7 +36,7 @@ class RssArticlesAdapter1(context: Context, callBack: CallBack) : if (item.image.isNullOrBlank() && !callBack.isGridLayout) { imageView.gone() } else { - ImageLoader.load(context, item.image).apply { + ImageLoader.load(context, item.image, item.origin).apply { if (callBack.isGridLayout) { placeholder(R.drawable.image_rss_article) } else { diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter2.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter2.kt index 5a512a063..99f892bda 100644 --- a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter2.kt +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter2.kt @@ -36,7 +36,7 @@ class RssArticlesAdapter2(context: Context, callBack: CallBack) : if (item.image.isNullOrBlank() && !callBack.isGridLayout) { imageView.gone() } else { - ImageLoader.load(context, item.image).apply { + ImageLoader.load(context, item.image, item.origin).apply { if (callBack.isGridLayout) { placeholder(R.drawable.image_rss_article) } else { diff --git a/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt index ba0a252c2..25cde23c0 100644 --- a/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt @@ -35,7 +35,7 @@ class RssFavoritesAdapter(context: Context, val callBack: CallBack) : if (item.image.isNullOrBlank()) { imageView.gone() } else { - ImageLoader.load(context, item.image) + ImageLoader.load(context, item.image, item.origin) .addListener(object : RequestListener { override fun onLoadFailed( e: GlideException?,