mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2025-01-12 08:49:08 +01:00
fixes from inspector
This commit is contained in:
parent
15bd5b4b7a
commit
884308690f
@ -124,10 +124,7 @@ object Extension {
|
||||
val sources: List<CatalogueSource> = when (val instance = loadExtensionSources(jarFilePath, className)) {
|
||||
is Source -> listOf(instance)
|
||||
is SourceFactory -> instance.createSources()
|
||||
|
||||
else -> {
|
||||
throw RuntimeException("Unknown source class type! ${instance.javaClass}")
|
||||
}
|
||||
else -> throw RuntimeException("Unknown source class type! ${instance.javaClass}")
|
||||
}.map { it as CatalogueSource }
|
||||
|
||||
val langs = sources.map { it.lang }.toSet()
|
||||
|
@ -7,6 +7,7 @@ package ir.armor.tachidesk.impl.util
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
import eu.kanade.tachiyomi.source.SourceFactory
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import ir.armor.tachidesk.impl.util.PackageTools.loadExtensionSources
|
||||
@ -40,17 +41,13 @@ object GetHttpSource {
|
||||
val jarName = apkName.substringBefore(".apk") + ".jar"
|
||||
val jarPath = "${ApplicationDirs.extensionsRoot}/$jarName"
|
||||
|
||||
val extensionInstance = loadExtensionSources(jarPath, className)
|
||||
|
||||
if (sourceRecord[SourceTable.partOfFactorySource]) {
|
||||
(extensionInstance as SourceFactory).createSources().forEach {
|
||||
when (val instance = loadExtensionSources(jarPath, className)) {
|
||||
is Source -> listOf(instance)
|
||||
is SourceFactory -> instance.createSources()
|
||||
else -> throw Exception("Unknown source class type! ${instance.javaClass}")
|
||||
}.forEach {
|
||||
sourceCache[it.id] = it as HttpSource
|
||||
}
|
||||
} else {
|
||||
(extensionInstance as HttpSource).also {
|
||||
sourceCache[it.id] = it
|
||||
}
|
||||
}
|
||||
return sourceCache[sourceId]!!
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user