From 05071b420572a8fa93a55ab02c743c7da4fd3b3a Mon Sep 17 00:00:00 2001 From: MajorTanya <39014446+MajorTanya@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:21:19 +0100 Subject: [PATCH] Fix extension repo crash with TypeReference issue (#574) Fix by @AntsyLich. Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> --- app/src/main/java/eu/kanade/domain/DomainModule.kt | 2 +- .../domain/extensionrepo/interactor/CreateExtensionRepo.kt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/domain/DomainModule.kt b/app/src/main/java/eu/kanade/domain/DomainModule.kt index 1d2a214ac..2bea7586b 100644 --- a/app/src/main/java/eu/kanade/domain/DomainModule.kt +++ b/app/src/main/java/eu/kanade/domain/DomainModule.kt @@ -181,7 +181,7 @@ class DomainModule : InjektModule { addSingletonFactory { ExtensionRepoRepositoryImpl(get()) } addFactory { GetExtensionRepo(get()) } addFactory { GetExtensionRepoCount(get()) } - addFactory { CreateExtensionRepo(get()) } + addFactory { CreateExtensionRepo(get(), get()) } addFactory { DeleteExtensionRepo(get()) } addFactory { ReplaceExtensionRepo(get()) } addFactory { UpdateExtensionRepo(get(), get()) } diff --git a/domain/src/main/java/mihon/domain/extensionrepo/interactor/CreateExtensionRepo.kt b/domain/src/main/java/mihon/domain/extensionrepo/interactor/CreateExtensionRepo.kt index 6285d4915..2e6de446d 100644 --- a/domain/src/main/java/mihon/domain/extensionrepo/interactor/CreateExtensionRepo.kt +++ b/domain/src/main/java/mihon/domain/extensionrepo/interactor/CreateExtensionRepo.kt @@ -8,17 +8,15 @@ import mihon.domain.extensionrepo.repository.ExtensionRepoRepository import mihon.domain.extensionrepo.service.ExtensionRepoService import okhttp3.OkHttpClient import tachiyomi.core.common.util.system.logcat -import uy.kohesive.injekt.injectLazy class CreateExtensionRepo( private val extensionRepoRepository: ExtensionRepoRepository, + private val networkHelper: NetworkHelper, ) { private val repoRegex = """^https://.*/index\.min\.json$""".toRegex() - private val networkService: NetworkHelper by injectLazy() - private val client: OkHttpClient - get() = networkService.client + get() = networkHelper.client private val extensionRepoService = ExtensionRepoService(client)