Fix extension repo crash with TypeReference issue

Fix by @AntsyLich.

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com>
This commit is contained in:
Secozzi 2024-07-03 19:13:15 +02:00
parent 5111522769
commit 233af962cd
No known key found for this signature in database
GPG key ID: 71E9C97D8DDC2662
3 changed files with 6 additions and 10 deletions

View file

@ -346,7 +346,7 @@ class DomainModule : InjektModule {
addSingletonFactory<AnimeExtensionRepoRepository> { AnimeExtensionRepoRepositoryImpl(get()) }
addFactory { GetAnimeExtensionRepo(get()) }
addFactory { GetAnimeExtensionRepoCount(get()) }
addFactory { CreateAnimeExtensionRepo(get()) }
addFactory { CreateAnimeExtensionRepo(get(), get()) }
addFactory { DeleteAnimeExtensionRepo(get()) }
addFactory { ReplaceAnimeExtensionRepo(get()) }
addFactory { UpdateAnimeExtensionRepo(get(), get()) }
@ -354,7 +354,7 @@ class DomainModule : InjektModule {
addSingletonFactory<MangaExtensionRepoRepository> { MangaExtensionRepoRepositoryImpl(get()) }
addFactory { GetMangaExtensionRepo(get()) }
addFactory { GetMangaExtensionRepoCount(get()) }
addFactory { CreateMangaExtensionRepo(get()) }
addFactory { CreateMangaExtensionRepo(get(), get()) }
addFactory { DeleteMangaExtensionRepo(get()) }
addFactory { ReplaceMangaExtensionRepo(get()) }
addFactory { UpdateMangaExtensionRepo(get(), get()) }

View file

@ -8,17 +8,15 @@ import mihon.domain.extensionrepo.model.ExtensionRepo
import mihon.domain.extensionrepo.service.ExtensionRepoService
import okhttp3.OkHttpClient
import tachiyomi.core.common.util.system.logcat
import uy.kohesive.injekt.injectLazy
class CreateAnimeExtensionRepo(
private val extensionRepoRepository: AnimeExtensionRepoRepository,
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)

View file

@ -8,17 +8,15 @@ import mihon.domain.extensionrepo.model.ExtensionRepo
import mihon.domain.extensionrepo.service.ExtensionRepoService
import okhttp3.OkHttpClient
import tachiyomi.core.common.util.system.logcat
import uy.kohesive.injekt.injectLazy
class CreateMangaExtensionRepo(
private val extensionRepoRepository: MangaExtensionRepoRepository,
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)