From d1b0af85c4d37f2255a731043beb1fce291dfa1b Mon Sep 17 00:00:00 2001 From: Koitharu Date: Tue, 5 Sep 2023 09:53:47 +0300 Subject: [PATCH] Update parsers --- app/build.gradle | 6 +++--- .../kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt | 2 ++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 49d21ff07..2a8cc2830 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId 'org.koitharu.kotatsu' minSdk = 21 targetSdk = 34 - versionCode = 575 - versionName = '6.0.2' + versionCode = 576 + versionName = '6.0.3' generatedDensities = [] testInstrumentationRunner "org.koitharu.kotatsu.HiltTestRunner" ksp { @@ -81,7 +81,7 @@ afterEvaluate { } dependencies { //noinspection GradleDependency - implementation('com.github.KotatsuApp:kotatsu-parsers:3a76504380') { + implementation('com.github.KotatsuApp:kotatsu-parsers:2f7e704e21') { exclude group: 'org.json', module: 'json' } diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt index f335ccdf9..7253337c1 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt @@ -27,6 +27,7 @@ import java.net.SocketTimeoutException import java.net.UnknownHostException private const val MSG_NO_SPACE_LEFT = "No space left on device" +private const val IMAGE_FORMAT_NO_SUPPORTED = "Image format not supported" fun Throwable.getDisplayMessage(resources: Resources): String = when (this) { is AuthRequiredException -> resources.getString(R.string.auth_required) @@ -81,6 +82,7 @@ private fun getHttpDisplayMessage(statusCode: Int, resources: Resources): String private fun getDisplayMessage(msg: String?, resources: Resources): String? = when { msg.isNullOrEmpty() -> null msg.contains(MSG_NO_SPACE_LEFT) -> resources.getString(R.string.error_no_space_left) + msg.contains(IMAGE_FORMAT_NO_SUPPORTED) -> resources.getString(R.string.error_corrupted_file) else -> null } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a5b00ba31..7d73f4bbb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -478,4 +478,5 @@ Advanced Default section Manga list + Invalid data is returned or file is corrupted