Add delegation support for configurable sources
This commit is contained in:
parent
ad82dc1c90
commit
988356e1ff
@ -30,6 +30,7 @@ import eu.kanade.tachiyomi.source.ConfigurableSource
|
|||||||
import eu.kanade.tachiyomi.source.Source
|
import eu.kanade.tachiyomi.source.Source
|
||||||
import eu.kanade.tachiyomi.source.getPreferenceKey
|
import eu.kanade.tachiyomi.source.getPreferenceKey
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||||
|
import exh.source.EnhancedHttpSource
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
@SuppressLint("RestrictedApi")
|
@SuppressLint("RestrictedApi")
|
||||||
@ -77,7 +78,13 @@ class SourcePreferencesController(bundle: Bundle? = null) :
|
|||||||
preferenceScreen = screen
|
preferenceScreen = screen
|
||||||
|
|
||||||
try {
|
try {
|
||||||
addPreferencesForSource(screen, source)
|
// SY -->
|
||||||
|
if (source is EnhancedHttpSource) {
|
||||||
|
addPreferencesForSource(screen, source.enchancedSource)
|
||||||
|
} else {
|
||||||
|
addPreferencesForSource(screen, source)
|
||||||
|
}
|
||||||
|
// SY <--
|
||||||
} catch (e: AbstractMethodError) {
|
} catch (e: AbstractMethodError) {
|
||||||
Timber.e("Source did not implement [addPreferencesForSource]: ${source.name}")
|
Timber.e("Source did not implement [addPreferencesForSource]: ${source.name}")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user