Fix batch add delegated sources
This commit is contained in:
parent
0ce63d0adc
commit
70c98e9c2b
@ -78,6 +78,10 @@ open class SourceManager(private val context: Context) {
|
||||
fun getVisibleCatalogueSources() = sourcesMap.values.filterIsInstance<CatalogueSource>().filter {
|
||||
it.id !in BlacklistedSources.HIDDEN_SOURCES
|
||||
}
|
||||
|
||||
fun getDelegatedCatalogueSources() = sourcesMap.values.filterIsInstance<EnhancedHttpSource>().mapNotNull { enhancedHttpSource ->
|
||||
enhancedHttpSource.enchancedSource as? DelegatedHttpSource
|
||||
}
|
||||
// SY <--
|
||||
|
||||
internal fun registerSource(source: Source, overwrite: Boolean = false) {
|
||||
|
@ -37,6 +37,15 @@ class GalleryAdder {
|
||||
}
|
||||
} else {
|
||||
sourceManager.getVisibleCatalogueSources()
|
||||
.filterIsInstance<UrlImportableSource>()
|
||||
.find {
|
||||
try {
|
||||
it.matchesUri(uri)
|
||||
} catch (e: Exception) {
|
||||
XLog.e("Source URI match check error!", e)
|
||||
false
|
||||
}
|
||||
} ?: sourceManager.getDelegatedCatalogueSources()
|
||||
.filterIsInstance<UrlImportableSource>()
|
||||
.find {
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user