From a04f848ad1c590dc852c433844633271470ea5f1 Mon Sep 17 00:00:00 2001 From: Jobobby04 Date: Sun, 10 Jan 2021 17:28:52 -0500 Subject: [PATCH] Unknown source error for Deeplink --- app/src/main/java/exh/GalleryAdder.kt | 8 ++++++-- app/src/main/res/values/strings_sy.xml | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/exh/GalleryAdder.kt b/app/src/main/java/exh/GalleryAdder.kt index ff49aef22..454360bd0 100755 --- a/app/src/main/java/exh/GalleryAdder.kt +++ b/app/src/main/java/exh/GalleryAdder.kt @@ -63,7 +63,7 @@ class GalleryAdder { val source = if (forceSource != null) { try { if (forceSource.matchesUri(uri)) forceSource - else return GalleryAddEvent.Fail.UnknownType(url, context) + else return GalleryAddEvent.Fail.UnknownSource(url, context) } catch (e: Exception) { logger.e(context.getString(R.string.gallery_adder_source_uri_must_match), e) return GalleryAddEvent.Fail.UnknownType(url, context) @@ -78,7 +78,7 @@ class GalleryAdder { } catch (e: Exception) { false } - } ?: return GalleryAddEvent.Fail.UnknownType(url, context) + } ?: return GalleryAddEvent.Fail.UnknownSource(url, context) } val realChapterUrl = try { @@ -212,5 +212,9 @@ sealed class GalleryAddEvent { class NotFound(galleryUrl: String, context: Context) : Error(galleryUrl, context.getString(R.string.batch_add_not_exist_log_message, galleryUrl)) + + class UnknownSource(override val galleryUrl: String, val context: Context) : Fail() { + override val logMessage = context.getString(R.string.batch_add_unknown_source_log_message, galleryUrl) + } } } diff --git a/app/src/main/res/values/strings_sy.xml b/app/src/main/res/values/strings_sy.xml index 5076dd9f8..a22aa15a0 100644 --- a/app/src/main/res/values/strings_sy.xml +++ b/app/src/main/res/values/strings_sy.xml @@ -436,6 +436,7 @@ \nSummary:\nAdded: %1$d gallerie(s)\nFailed: %2$d gallerie(s) Added manga: %1$s Unknown manga type for manga: %1$s + Unknown source for manga: %1$s Manga does not exist: %1$s Importing manga (url: %1$s, fav: %2$s, forceSource: %3$s)… Source URI match check error!