Fix extension repo crash with TypeReference issue (#574)

Fix by @AntsyLich.

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
MajorTanya 2024-03-23 23:21:19 +01:00 committed by GitHub
parent da20d00481
commit 05071b4205
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View File

@ -181,7 +181,7 @@ class DomainModule : InjektModule {
addSingletonFactory<ExtensionRepoRepository> { ExtensionRepoRepositoryImpl(get()) } addSingletonFactory<ExtensionRepoRepository> { ExtensionRepoRepositoryImpl(get()) }
addFactory { GetExtensionRepo(get()) } addFactory { GetExtensionRepo(get()) }
addFactory { GetExtensionRepoCount(get()) } addFactory { GetExtensionRepoCount(get()) }
addFactory { CreateExtensionRepo(get()) } addFactory { CreateExtensionRepo(get(), get()) }
addFactory { DeleteExtensionRepo(get()) } addFactory { DeleteExtensionRepo(get()) }
addFactory { ReplaceExtensionRepo(get()) } addFactory { ReplaceExtensionRepo(get()) }
addFactory { UpdateExtensionRepo(get(), get()) } addFactory { UpdateExtensionRepo(get(), get()) }

View File

@ -8,17 +8,15 @@ import mihon.domain.extensionrepo.repository.ExtensionRepoRepository
import mihon.domain.extensionrepo.service.ExtensionRepoService import mihon.domain.extensionrepo.service.ExtensionRepoService
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import tachiyomi.core.common.util.system.logcat import tachiyomi.core.common.util.system.logcat
import uy.kohesive.injekt.injectLazy
class CreateExtensionRepo( class CreateExtensionRepo(
private val extensionRepoRepository: ExtensionRepoRepository, private val extensionRepoRepository: ExtensionRepoRepository,
private val networkHelper: NetworkHelper,
) { ) {
private val repoRegex = """^https://.*/index\.min\.json$""".toRegex() private val repoRegex = """^https://.*/index\.min\.json$""".toRegex()
private val networkService: NetworkHelper by injectLazy()
private val client: OkHttpClient private val client: OkHttpClient
get() = networkService.client get() = networkHelper.client
private val extensionRepoService = ExtensionRepoService(client) private val extensionRepoService = ExtensionRepoService(client)