2022-04-23 05:29:24 +08:00
|
|
|
package eu.kanade.domain
|
|
|
|
|
2022-06-16 22:59:10 +08:00
|
|
|
import eu.kanade.data.category.CategoryRepositoryImpl
|
2022-05-28 21:09:27 +08:00
|
|
|
import eu.kanade.data.chapter.ChapterRepositoryImpl
|
2022-04-23 05:29:24 +08:00
|
|
|
import eu.kanade.data.history.HistoryRepositoryImpl
|
2022-04-30 21:37:10 +08:00
|
|
|
import eu.kanade.data.manga.MangaRepositoryImpl
|
2022-04-25 02:35:59 +08:00
|
|
|
import eu.kanade.data.source.SourceRepositoryImpl
|
2022-06-16 22:59:10 +08:00
|
|
|
import eu.kanade.domain.category.interactor.DeleteCategory
|
|
|
|
import eu.kanade.domain.category.interactor.GetCategories
|
|
|
|
import eu.kanade.domain.category.interactor.InsertCategory
|
|
|
|
import eu.kanade.domain.category.interactor.UpdateCategory
|
|
|
|
import eu.kanade.domain.category.repository.CategoryRepository
|
2022-06-12 23:23:41 +08:00
|
|
|
import eu.kanade.domain.chapter.interactor.GetChapterByMangaId
|
2022-06-11 23:38:39 +08:00
|
|
|
import eu.kanade.domain.chapter.interactor.ShouldUpdateDbChapter
|
|
|
|
import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource
|
2022-05-28 21:09:27 +08:00
|
|
|
import eu.kanade.domain.chapter.interactor.UpdateChapter
|
|
|
|
import eu.kanade.domain.chapter.repository.ChapterRepository
|
2022-05-20 05:29:40 +08:00
|
|
|
import eu.kanade.domain.extension.interactor.GetExtensionLanguages
|
2022-05-08 11:34:55 +08:00
|
|
|
import eu.kanade.domain.extension.interactor.GetExtensionSources
|
2022-05-15 21:59:53 +08:00
|
|
|
import eu.kanade.domain.extension.interactor.GetExtensionUpdates
|
|
|
|
import eu.kanade.domain.extension.interactor.GetExtensions
|
2022-04-23 05:29:24 +08:00
|
|
|
import eu.kanade.domain.history.interactor.DeleteHistoryTable
|
|
|
|
import eu.kanade.domain.history.interactor.GetHistory
|
2022-06-01 10:55:58 +08:00
|
|
|
import eu.kanade.domain.history.interactor.GetNextChapter
|
2022-04-23 05:29:24 +08:00
|
|
|
import eu.kanade.domain.history.interactor.RemoveHistoryById
|
|
|
|
import eu.kanade.domain.history.interactor.RemoveHistoryByMangaId
|
2022-05-28 21:09:27 +08:00
|
|
|
import eu.kanade.domain.history.interactor.UpsertHistory
|
2022-04-23 05:29:24 +08:00
|
|
|
import eu.kanade.domain.history.repository.HistoryRepository
|
2022-04-30 21:37:10 +08:00
|
|
|
import eu.kanade.domain.manga.interactor.GetFavoritesBySourceId
|
2022-06-12 22:21:45 +08:00
|
|
|
import eu.kanade.domain.manga.interactor.GetMangaById
|
2022-05-12 21:00:57 +08:00
|
|
|
import eu.kanade.domain.manga.interactor.ResetViewerFlags
|
2022-06-12 22:21:45 +08:00
|
|
|
import eu.kanade.domain.manga.interactor.UpdateManga
|
2022-04-30 21:37:10 +08:00
|
|
|
import eu.kanade.domain.manga.repository.MangaRepository
|
2022-04-25 02:35:59 +08:00
|
|
|
import eu.kanade.domain.source.interactor.GetEnabledSources
|
2022-04-30 23:49:02 +08:00
|
|
|
import eu.kanade.domain.source.interactor.GetLanguagesWithSources
|
2022-06-14 21:10:40 +08:00
|
|
|
import eu.kanade.domain.source.interactor.GetSourceData
|
2022-04-27 20:36:16 +08:00
|
|
|
import eu.kanade.domain.source.interactor.GetSourcesWithFavoriteCount
|
2022-06-11 09:33:56 +08:00
|
|
|
import eu.kanade.domain.source.interactor.GetSourcesWithNonLibraryManga
|
2022-04-27 20:36:16 +08:00
|
|
|
import eu.kanade.domain.source.interactor.SetMigrateSorting
|
2022-04-30 23:49:02 +08:00
|
|
|
import eu.kanade.domain.source.interactor.ToggleLanguage
|
|
|
|
import eu.kanade.domain.source.interactor.ToggleSource
|
2022-04-25 02:35:59 +08:00
|
|
|
import eu.kanade.domain.source.interactor.ToggleSourcePin
|
2022-06-14 21:10:40 +08:00
|
|
|
import eu.kanade.domain.source.interactor.UpsertSourceData
|
2022-04-25 02:35:59 +08:00
|
|
|
import eu.kanade.domain.source.repository.SourceRepository
|
2022-04-23 05:29:24 +08: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-06-16 22:59:10 +08:00
|
|
|
addSingletonFactory<CategoryRepository> { CategoryRepositoryImpl(get()) }
|
|
|
|
addFactory { GetCategories(get()) }
|
|
|
|
addFactory { InsertCategory(get()) }
|
|
|
|
addFactory { UpdateCategory(get()) }
|
|
|
|
addFactory { DeleteCategory(get()) }
|
|
|
|
|
2022-04-30 21:37:10 +08:00
|
|
|
addSingletonFactory<MangaRepository> { MangaRepositoryImpl(get()) }
|
|
|
|
addFactory { GetFavoritesBySourceId(get()) }
|
2022-06-12 22:21:45 +08:00
|
|
|
addFactory { GetMangaById(get()) }
|
2022-06-01 10:55:58 +08:00
|
|
|
addFactory { GetNextChapter(get()) }
|
2022-05-12 21:00:57 +08:00
|
|
|
addFactory { ResetViewerFlags(get()) }
|
2022-06-12 22:21:45 +08:00
|
|
|
addFactory { UpdateManga(get()) }
|
2022-04-25 04:16:05 +08:00
|
|
|
|
2022-05-28 21:09:27 +08:00
|
|
|
addSingletonFactory<ChapterRepository> { ChapterRepositoryImpl(get()) }
|
2022-06-12 23:23:41 +08:00
|
|
|
addFactory { GetChapterByMangaId(get()) }
|
2022-05-28 21:09:27 +08:00
|
|
|
addFactory { UpdateChapter(get()) }
|
2022-06-11 23:38:39 +08:00
|
|
|
addFactory { ShouldUpdateDbChapter() }
|
|
|
|
addFactory { SyncChaptersWithSource(get(), get(), get(), get()) }
|
2022-05-28 21:09:27 +08:00
|
|
|
|
2022-04-23 05:29:24 +08:00
|
|
|
addSingletonFactory<HistoryRepository> { HistoryRepositoryImpl(get()) }
|
|
|
|
addFactory { DeleteHistoryTable(get()) }
|
|
|
|
addFactory { GetHistory(get()) }
|
2022-05-28 21:09:27 +08:00
|
|
|
addFactory { UpsertHistory(get()) }
|
2022-04-23 05:29:24 +08:00
|
|
|
addFactory { RemoveHistoryById(get()) }
|
|
|
|
addFactory { RemoveHistoryByMangaId(get()) }
|
2022-04-25 04:16:05 +08:00
|
|
|
|
2022-05-15 21:59:53 +08:00
|
|
|
addFactory { GetExtensions(get(), get()) }
|
2022-05-08 11:34:55 +08:00
|
|
|
addFactory { GetExtensionSources(get()) }
|
2022-05-15 21:59:53 +08:00
|
|
|
addFactory { GetExtensionUpdates(get(), get()) }
|
2022-05-20 05:29:40 +08:00
|
|
|
addFactory { GetExtensionLanguages(get(), get()) }
|
2022-05-15 21:59:53 +08:00
|
|
|
|
2022-04-27 20:36:16 +08:00
|
|
|
addSingletonFactory<SourceRepository> { SourceRepositoryImpl(get(), get()) }
|
2022-04-25 02:35:59 +08:00
|
|
|
addFactory { GetEnabledSources(get(), get()) }
|
2022-06-11 09:33:56 +08:00
|
|
|
addFactory { GetLanguagesWithSources(get(), get()) }
|
2022-06-14 21:10:40 +08:00
|
|
|
addFactory { GetSourceData(get()) }
|
2022-04-27 20:36:16 +08:00
|
|
|
addFactory { GetSourcesWithFavoriteCount(get(), get()) }
|
2022-06-11 09:33:56 +08:00
|
|
|
addFactory { GetSourcesWithNonLibraryManga(get()) }
|
2022-04-27 20:36:16 +08:00
|
|
|
addFactory { SetMigrateSorting(get()) }
|
2022-04-30 23:49:02 +08:00
|
|
|
addFactory { ToggleLanguage(get()) }
|
2022-06-11 09:33:56 +08:00
|
|
|
addFactory { ToggleSource(get()) }
|
|
|
|
addFactory { ToggleSourcePin(get()) }
|
2022-06-14 21:10:40 +08:00
|
|
|
addFactory { UpsertSourceData(get()) }
|
2022-04-23 05:29:24 +08:00
|
|
|
}
|
|
|
|
}
|