mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-18 14:43:55 +00:00
fix: avoid waiting on network for local exts
This commit is contained in:
@@ -113,21 +113,28 @@ class App : MultiDexApplication() {
|
||||
}
|
||||
}
|
||||
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
val scope = CoroutineScope(Dispatchers.IO)
|
||||
scope.launch {
|
||||
animeExtensionManager = Injekt.get()
|
||||
animeExtensionManager.findAvailableExtensions()
|
||||
launch {
|
||||
animeExtensionManager.findAvailableExtensions()
|
||||
}
|
||||
Logger.log("Anime Extensions: ${animeExtensionManager.installedExtensionsFlow.first()}")
|
||||
AnimeSources.init(animeExtensionManager.installedExtensionsFlow)
|
||||
}
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
scope.launch {
|
||||
mangaExtensionManager = Injekt.get()
|
||||
mangaExtensionManager.findAvailableExtensions()
|
||||
launch {
|
||||
mangaExtensionManager.findAvailableExtensions()
|
||||
}
|
||||
Logger.log("Manga Extensions: ${mangaExtensionManager.installedExtensionsFlow.first()}")
|
||||
MangaSources.init(mangaExtensionManager.installedExtensionsFlow)
|
||||
}
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
scope.launch {
|
||||
novelExtensionManager = Injekt.get()
|
||||
novelExtensionManager.findAvailableExtensions()
|
||||
launch {
|
||||
novelExtensionManager.findAvailableExtensions()
|
||||
}
|
||||
Logger.log("Novel Extensions: ${novelExtensionManager.installedExtensionsFlow.first()}")
|
||||
NovelSources.init(novelExtensionManager.installedExtensionsFlow)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ object AnimeSources : WatchSources() {
|
||||
)
|
||||
isInitialized = true
|
||||
|
||||
// Update as StateFlow emits new values
|
||||
fromExtensions.collect { extensions ->
|
||||
list = sortPinnedAnimeSources(
|
||||
createParsersFromExtensions(extensions),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.extension.api
|
||||
|
||||
import ani.dantotsu.asyncMap
|
||||
import ani.dantotsu.parsers.novel.AvailableNovelSources
|
||||
import ani.dantotsu.parsers.novel.NovelExtension
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
@@ -67,7 +68,7 @@ internal class ExtensionGithubApi {
|
||||
val repos =
|
||||
PrefManager.getVal<Set<String>>(PrefName.AnimeExtensionRepos).toMutableList()
|
||||
|
||||
repos.forEach {
|
||||
repos.asyncMap {
|
||||
val repoUrl = if (it.contains("index.min.json")) {
|
||||
it
|
||||
} else {
|
||||
@@ -155,7 +156,7 @@ internal class ExtensionGithubApi {
|
||||
val repos =
|
||||
PrefManager.getVal<Set<String>>(PrefName.MangaExtensionRepos).toMutableList()
|
||||
|
||||
repos.forEach {
|
||||
repos.asyncMap {
|
||||
val repoUrl = if (it.contains("index.min.json")) {
|
||||
it
|
||||
} else {
|
||||
@@ -207,7 +208,7 @@ internal class ExtensionGithubApi {
|
||||
val repos =
|
||||
PrefManager.getVal<Set<String>>(PrefName.NovelExtensionRepos).toMutableList()
|
||||
|
||||
repos.forEach {
|
||||
repos.asyncMap {
|
||||
val repoUrl = if (it.contains("index.min.json")) {
|
||||
it
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user