2022-04-22 17:29:24 -04:00
|
|
|
package eu.kanade.domain
|
|
|
|
|
|
|
|
import eu.kanade.data.history.HistoryRepositoryImpl
|
2022-04-30 09:37:10 -04:00
|
|
|
import eu.kanade.data.manga.MangaRepositoryImpl
|
2022-04-24 14:35:59 -04:00
|
|
|
import eu.kanade.data.source.SourceRepositoryImpl
|
2022-04-22 17:29:24 -04:00
|
|
|
import eu.kanade.domain.history.interactor.DeleteHistoryTable
|
|
|
|
import eu.kanade.domain.history.interactor.GetHistory
|
|
|
|
import eu.kanade.domain.history.interactor.GetNextChapterForManga
|
|
|
|
import eu.kanade.domain.history.interactor.RemoveHistoryById
|
|
|
|
import eu.kanade.domain.history.interactor.RemoveHistoryByMangaId
|
|
|
|
import eu.kanade.domain.history.repository.HistoryRepository
|
2022-04-30 09:37:10 -04:00
|
|
|
import eu.kanade.domain.manga.interactor.GetFavoritesBySourceId
|
2022-05-12 09:00:57 -04:00
|
|
|
import eu.kanade.domain.manga.interactor.ResetViewerFlags
|
2022-04-30 09:37:10 -04:00
|
|
|
import eu.kanade.domain.manga.repository.MangaRepository
|
2022-04-24 14:35:59 -04:00
|
|
|
import eu.kanade.domain.source.interactor.GetEnabledSources
|
2022-04-30 11:49:02 -04:00
|
|
|
import eu.kanade.domain.source.interactor.GetLanguagesWithSources
|
2022-04-27 08:36:16 -04:00
|
|
|
import eu.kanade.domain.source.interactor.GetSourcesWithFavoriteCount
|
|
|
|
import eu.kanade.domain.source.interactor.SetMigrateSorting
|
2022-04-30 11:49:02 -04:00
|
|
|
import eu.kanade.domain.source.interactor.ToggleLanguage
|
|
|
|
import eu.kanade.domain.source.interactor.ToggleSource
|
2022-04-24 14:35:59 -04:00
|
|
|
import eu.kanade.domain.source.interactor.ToggleSourcePin
|
|
|
|
import eu.kanade.domain.source.repository.SourceRepository
|
2022-04-22 17:29:24 -04:00
|
|
|
import uy.kohesive.injekt.api.InjektModule
|
|
|
|
import uy.kohesive.injekt.api.InjektRegistrar
|
|
|
|
import uy.kohesive.injekt.api.addFactory
|
|
|
|
import uy.kohesive.injekt.api.addSingletonFactory
|
|
|
|
import uy.kohesive.injekt.api.get
|
|
|
|
|
|
|
|
class DomainModule : InjektModule {
|
|
|
|
|
|
|
|
override fun InjektRegistrar.registerInjectables() {
|
2022-04-30 09:37:10 -04:00
|
|
|
addSingletonFactory<MangaRepository> { MangaRepositoryImpl(get()) }
|
|
|
|
addFactory { GetFavoritesBySourceId(get()) }
|
2022-04-24 16:16:05 -04:00
|
|
|
addFactory { GetNextChapterForManga(get()) }
|
2022-05-12 09:00:57 -04:00
|
|
|
addFactory { ResetViewerFlags(get()) }
|
2022-04-24 16:16:05 -04:00
|
|
|
|
2022-04-22 17:29:24 -04:00
|
|
|
addSingletonFactory<HistoryRepository> { HistoryRepositoryImpl(get()) }
|
|
|
|
addFactory { DeleteHistoryTable(get()) }
|
|
|
|
addFactory { GetHistory(get()) }
|
|
|
|
addFactory { RemoveHistoryById(get()) }
|
|
|
|
addFactory { RemoveHistoryByMangaId(get()) }
|
2022-04-24 16:16:05 -04:00
|
|
|
|
2022-04-27 08:36:16 -04:00
|
|
|
addSingletonFactory<SourceRepository> { SourceRepositoryImpl(get(), get()) }
|
2022-04-30 11:49:02 -04:00
|
|
|
addFactory { GetLanguagesWithSources(get(), get()) }
|
2022-04-24 14:35:59 -04:00
|
|
|
addFactory { GetEnabledSources(get(), get()) }
|
2022-04-30 11:49:02 -04:00
|
|
|
addFactory { ToggleSource(get()) }
|
2022-04-24 14:35:59 -04:00
|
|
|
addFactory { ToggleSourcePin(get()) }
|
2022-04-27 08:36:16 -04:00
|
|
|
addFactory { GetSourcesWithFavoriteCount(get(), get()) }
|
|
|
|
addFactory { SetMigrateSorting(get()) }
|
2022-04-30 11:49:02 -04:00
|
|
|
addFactory { ToggleLanguage(get()) }
|
2022-04-22 17:29:24 -04:00
|
|
|
}
|
|
|
|
}
|