mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Remove source overwrite logic since built-in sources no longer exist
This commit is contained in:
parent
836aec4396
commit
1a439ecece
2 changed files with 4 additions and 5 deletions
|
@ -124,8 +124,7 @@ class ExtensionManager(
|
||||||
.map { it.extension }
|
.map { it.extension }
|
||||||
installedExtensions
|
installedExtensions
|
||||||
.flatMap { it.sources }
|
.flatMap { it.sources }
|
||||||
// overwrite is needed until the bundled sources are removed
|
.forEach { sourceManager.registerSource(it) }
|
||||||
.forEach { sourceManager.registerSource(it, true) }
|
|
||||||
|
|
||||||
untrustedExtensions = extensions
|
untrustedExtensions = extensions
|
||||||
.filterIsInstance<LoadResult.Untrusted>()
|
.filterIsInstance<LoadResult.Untrusted>()
|
||||||
|
|
|
@ -32,11 +32,11 @@ open class SourceManager(private val context: Context) {
|
||||||
|
|
||||||
fun getCatalogueSources() = sourcesMap.values.filterIsInstance<CatalogueSource>()
|
fun getCatalogueSources() = sourcesMap.values.filterIsInstance<CatalogueSource>()
|
||||||
|
|
||||||
internal fun registerSource(source: Source, overwrite: Boolean = false) {
|
internal fun registerSource(source: Source) {
|
||||||
if (overwrite || !sourcesMap.containsKey(source.id)) {
|
if (!sourcesMap.containsKey(source.id)) {
|
||||||
sourcesMap[source.id] = source
|
sourcesMap[source.id] = source
|
||||||
}
|
}
|
||||||
if (overwrite || !stubSourcesMap.containsKey(source.id)) {
|
if (!stubSourcesMap.containsKey(source.id)) {
|
||||||
stubSourcesMap[source.id] = StubSource(source.id)
|
stubSourcesMap[source.id] = StubSource(source.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue