From 9670863a418c39d2371e20b20557e7075961cb5e Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 10 Jan 2021 11:11:53 -0500 Subject: [PATCH] Show error when trying to download chapters from not installed source (closes #4283) --- .../main/java/eu/kanade/tachiyomi/source/SourceManager.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/manga/MangaController.kt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt b/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt index 7c9486819a..89ae2e951d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt @@ -49,7 +49,7 @@ open class SourceManager(private val context: Context) { LocalSource(context) ) - private inner class StubSource(override val id: Long) : Source { + inner class StubSource(override val id: Long) : Source { override val name: String get() = id.toString() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index 8210f11b7a..5d09b136c6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -917,6 +917,11 @@ class MangaController : } private fun downloadChapters(chapters: List) { + if (source is SourceManager.StubSource) { + activity?.toast(R.string.loader_not_implemented_error) + return + } + val view = view val manga = presenter.manga presenter.downloadChapters(chapters)