From 1a439ecece5e2963a5e6ba9761adad90f8c0bb29 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 12 Dec 2020 16:15:18 -0500 Subject: [PATCH] Remove source overwrite logic since built-in sources no longer exist --- .../java/eu/kanade/tachiyomi/extension/ExtensionManager.kt | 3 +-- .../main/java/eu/kanade/tachiyomi/source/SourceManager.kt | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt index 785cc70c16..391bdd686e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt @@ -124,8 +124,7 @@ class ExtensionManager( .map { it.extension } installedExtensions .flatMap { it.sources } - // overwrite is needed until the bundled sources are removed - .forEach { sourceManager.registerSource(it, true) } + .forEach { sourceManager.registerSource(it) } untrustedExtensions = extensions .filterIsInstance() 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 f8586ea246..7c9486819a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt @@ -32,11 +32,11 @@ open class SourceManager(private val context: Context) { fun getCatalogueSources() = sourcesMap.values.filterIsInstance() - internal fun registerSource(source: Source, overwrite: Boolean = false) { - if (overwrite || !sourcesMap.containsKey(source.id)) { + internal fun registerSource(source: Source) { + if (!sourcesMap.containsKey(source.id)) { sourcesMap[source.id] = source } - if (overwrite || !stubSourcesMap.containsKey(source.id)) { + if (!stubSourcesMap.containsKey(source.id)) { stubSourcesMap[source.id] = StubSource(source.id) } }