From 337e210b5b7a9f21a074e53ccc101877a7d3031c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 00:05:54 +0000 Subject: [PATCH 1/3] Update dependency com.google.android.material:material to v1.11.0-alpha02 --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 46f71c76e..bf7a96103 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -216,7 +216,7 @@ dependencies { val accompanist_version = "0.31.6-rc" implementation("com.google.accompanist:accompanist-themeadapter-material3:$accompanist_version") implementation("com.google.accompanist:accompanist-webview:$accompanist_version") - implementation("com.google.android.material:material:1.11.0-alpha01") + implementation("com.google.android.material:material:1.11.0-alpha02") val splitties = "3.0.0" implementation("com.louiscad.splitties:splitties-appctx:$splitties") From b4080302c3113f6352058b7bdae3da99ecdf838e Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Tue, 15 Aug 2023 15:44:52 +0800 Subject: [PATCH 2/3] Refine GalleryListParser --- .../client/parser/GalleryListParser.kt | 19 +++++++++++++++---- .../ehviewer/ui/scene/GalleryListScene.kt | 7 +------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryListParser.kt b/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryListParser.kt index d6ca9f5cf..7381df195 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryListParser.kt +++ b/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryListParser.kt @@ -1,9 +1,12 @@ package com.hippo.ehviewer.client.parser import com.hippo.ehviewer.EhDB +import com.hippo.ehviewer.R import com.hippo.ehviewer.client.data.BaseGalleryInfo import com.hippo.ehviewer.client.data.GalleryInfo.Companion.LOCAL_FAVORITED import com.hippo.ehviewer.client.data.GalleryInfo.Companion.NOT_FAVORITED +import com.hippo.ehviewer.client.exception.EhException +import com.hippo.ehviewer.client.exception.ParseException object GalleryListParser { suspend fun parse(body: String) = runCatching { @@ -15,13 +18,21 @@ object GalleryListParser { it.generateSLang() } } - }.getOrDefault(GalleryListResult()) + }.getOrElse { + if (body.contains("
You do not have any watched tags")) { + throw EhException(R.string.gallery_list_empty_hit_subscription) + } + if (body.contains("No hits found
")) { + throw EhException(R.string.gallery_list_empty_hit) + } + throw ParseException("Can't parse gallery list", body, it) + } } class GalleryListResult( - val prev: String? = null, - val next: String? = null, - val galleryInfoList: ArrayList