Unknown source error for Deeplink

This commit is contained in:
Jobobby04
2021-01-10 17:28:52 -05:00
parent 73e861ec9e
commit a04f848ad1
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -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)
}
}
}