mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-21 12:17:12 +03:00
ktlint formt
This commit is contained in:
parent
ea2b7fe7c0
commit
3a3115304e
13 changed files with 26 additions and 26 deletions
|
@ -1,6 +1,6 @@
|
|||
package eu.kanade.domain
|
||||
|
||||
import eu.kanade.domain.download.anime.interactor.DeleteAnimeDownload
|
||||
import eu.kanade.domain.download.anime.interactor.DeleteEpisodeDownload
|
||||
import eu.kanade.domain.download.manga.interactor.DeleteChapterDownload
|
||||
import eu.kanade.domain.entries.anime.interactor.SetAnimeViewerFlags
|
||||
import eu.kanade.domain.entries.anime.interactor.UpdateAnime
|
||||
|
@ -251,7 +251,7 @@ class DomainModule : InjektModule {
|
|||
addFactory { UpsertAnimeHistory(get()) }
|
||||
addFactory { RemoveAnimeHistory(get()) }
|
||||
|
||||
addFactory { DeleteAnimeDownload(get(), get()) }
|
||||
addFactory { DeleteEpisodeDownload(get(), get()) }
|
||||
|
||||
addFactory { GetAnimeExtensionsByType(get(), get()) }
|
||||
addFactory { GetAnimeExtensionSources(get()) }
|
||||
|
|
|
@ -6,7 +6,7 @@ import tachiyomi.domain.entries.anime.model.Anime
|
|||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
|
||||
class DeleteAnimeDownload(
|
||||
class DeleteEpisodeDownload(
|
||||
private val sourceManager: AnimeSourceManager,
|
||||
private val downloadManager: AnimeDownloadManager,
|
||||
) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package eu.kanade.domain.items.episode.interactor
|
||||
|
||||
import eu.kanade.domain.download.anime.interactor.DeleteAnimeDownload
|
||||
import eu.kanade.domain.download.anime.interactor.DeleteEpisodeDownload
|
||||
import logcat.LogPriority
|
||||
import tachiyomi.core.util.lang.withNonCancellableContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
|
@ -13,7 +13,7 @@ import tachiyomi.domain.items.episode.repository.EpisodeRepository
|
|||
|
||||
class SetSeenStatus(
|
||||
private val downloadPreferences: DownloadPreferences,
|
||||
private val deleteDownload: DeleteAnimeDownload,
|
||||
private val deleteDownload: DeleteEpisodeDownload,
|
||||
private val animeRepository: AnimeRepository,
|
||||
private val episodeRepository: EpisodeRepository,
|
||||
) {
|
||||
|
|
|
@ -12,7 +12,7 @@ import eu.kanade.presentation.browse.manga.components.BaseMangaSourceItem
|
|||
import eu.kanade.presentation.components.AppBar
|
||||
import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.source.SourcesFilterScreenModel
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.source.MangaSourcesFilterScreenModel
|
||||
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
||||
import tachiyomi.domain.source.manga.model.Source
|
||||
import tachiyomi.presentation.core.components.FastScrollLazyColumn
|
||||
|
@ -22,7 +22,7 @@ import tachiyomi.presentation.core.screens.EmptyScreen
|
|||
@Composable
|
||||
fun MangaSourcesFilterScreen(
|
||||
navigateUp: () -> Unit,
|
||||
state: SourcesFilterScreenModel.State.Success,
|
||||
state: MangaSourcesFilterScreenModel.State.Success,
|
||||
onClickLanguage: (String) -> Unit,
|
||||
onClickSource: (Source) -> Unit,
|
||||
) {
|
||||
|
@ -54,7 +54,7 @@ fun MangaSourcesFilterScreen(
|
|||
@Composable
|
||||
private fun SourcesFilterContent(
|
||||
contentPadding: PaddingValues,
|
||||
state: SourcesFilterScreenModel.State.Success,
|
||||
state: MangaSourcesFilterScreenModel.State.Success,
|
||||
onClickLanguage: (String) -> Unit,
|
||||
onClickSource: (Source) -> Unit,
|
||||
) {
|
||||
|
|
|
@ -26,7 +26,7 @@ import eu.kanade.domain.source.service.SetMigrateSorting
|
|||
import eu.kanade.presentation.browse.manga.components.BaseMangaSourceItem
|
||||
import eu.kanade.presentation.browse.manga.components.MangaSourceIcon
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.migration.sources.MigrateSourceScreenModel
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.migration.sources.MigrateMangaSourceScreenModel
|
||||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import tachiyomi.domain.source.manga.model.Source
|
||||
import tachiyomi.presentation.core.components.Badge
|
||||
|
@ -43,7 +43,7 @@ import tachiyomi.presentation.core.util.secondaryItemAlpha
|
|||
|
||||
@Composable
|
||||
fun MigrateMangaSourceScreen(
|
||||
state: MigrateSourceScreenModel.State,
|
||||
state: MigrateMangaSourceScreenModel.State,
|
||||
contentPadding: PaddingValues,
|
||||
onClickItem: (Source) -> Unit,
|
||||
onToggleSortingDirection: () -> Unit,
|
||||
|
|
|
@ -11,7 +11,7 @@ import cafe.adriel.voyager.navigator.currentOrThrow
|
|||
import eu.kanade.presentation.browse.manga.MigrateMangaScreen
|
||||
import eu.kanade.presentation.util.Screen
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.migration.search.MigrateSearchScreen
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.migration.search.MigrateMangaSearchScreen
|
||||
import eu.kanade.tachiyomi.ui.entries.manga.MangaScreen
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
|
@ -38,7 +38,7 @@ data class MigrateMangaScreen(
|
|||
navigateUp = navigator::pop,
|
||||
title = state.source!!.name,
|
||||
state = state,
|
||||
onClickItem = { navigator.push(MigrateSearchScreen(it.id)) },
|
||||
onClickItem = { navigator.push(MigrateMangaSearchScreen(it.id)) },
|
||||
onClickCover = { navigator.push(MangaScreen(it.id)) },
|
||||
)
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ import eu.kanade.presentation.browse.manga.MigrateMangaSearchScreen
|
|||
import eu.kanade.presentation.util.Screen
|
||||
import eu.kanade.tachiyomi.ui.entries.manga.MangaScreen
|
||||
|
||||
class MigrateSearchScreen(private val mangaId: Long) : Screen() {
|
||||
class MigrateMangaSearchScreen(private val mangaId: Long) : Screen() {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
|
||||
val screenModel = rememberScreenModel { MigrateSearchScreenModel(mangaId = mangaId) }
|
||||
val screenModel = rememberScreenModel { MigrateMangaSearchScreenModel(mangaId = mangaId) }
|
||||
val state by screenModel.state.collectAsState()
|
||||
|
||||
val dialogScreenModel = rememberScreenModel {
|
||||
|
|
|
@ -10,7 +10,7 @@ import tachiyomi.domain.entries.manga.interactor.GetManga
|
|||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
class MigrateSearchScreenModel(
|
||||
class MigrateMangaSearchScreenModel(
|
||||
val mangaId: Long,
|
||||
initialExtensionFilter: String = "",
|
||||
getManga: GetManga = Injekt.get(),
|
||||
|
|
|
@ -20,11 +20,11 @@ import tachiyomi.domain.source.manga.model.Source
|
|||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
class MigrateSourceScreenModel(
|
||||
class MigrateMangaSourceScreenModel(
|
||||
preferences: SourcePreferences = Injekt.get(),
|
||||
private val getSourcesWithFavoriteCount: GetMangaSourcesWithFavoriteCount = Injekt.get(),
|
||||
private val setMigrateSorting: SetMigrateSorting = Injekt.get(),
|
||||
) : StateScreenModel<MigrateSourceScreenModel.State>(State()) {
|
||||
) : StateScreenModel<MigrateMangaSourceScreenModel.State>(State()) {
|
||||
|
||||
private val _channel = Channel<Event>(Int.MAX_VALUE)
|
||||
val channel = _channel.receiveAsFlow()
|
||||
|
|
|
@ -21,7 +21,7 @@ import eu.kanade.tachiyomi.ui.browse.manga.migration.manga.MigrateMangaScreen
|
|||
fun Screen.migrateMangaSourceTab(): TabContent {
|
||||
val uriHandler = LocalUriHandler.current
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
val screenModel = rememberScreenModel { MigrateSourceScreenModel() }
|
||||
val screenModel = rememberScreenModel { MigrateMangaSourceScreenModel() }
|
||||
val state by screenModel.state.collectAsState()
|
||||
|
||||
return TabContent(
|
||||
|
|
|
@ -19,15 +19,15 @@ class MangaSourcesFilterScreen : Screen() {
|
|||
@Composable
|
||||
override fun Content() {
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
val screenModel = rememberScreenModel { SourcesFilterScreenModel() }
|
||||
val screenModel = rememberScreenModel { MangaSourcesFilterScreenModel() }
|
||||
val state by screenModel.state.collectAsState()
|
||||
|
||||
if (state is SourcesFilterScreenModel.State.Loading) {
|
||||
if (state is MangaSourcesFilterScreenModel.State.Loading) {
|
||||
LoadingScreen()
|
||||
return
|
||||
}
|
||||
|
||||
if (state is SourcesFilterScreenModel.State.Error) {
|
||||
if (state is MangaSourcesFilterScreenModel.State.Error) {
|
||||
val context = LocalContext.current
|
||||
LaunchedEffect(Unit) {
|
||||
context.toast(R.string.internal_error)
|
||||
|
@ -36,7 +36,7 @@ class MangaSourcesFilterScreen : Screen() {
|
|||
return
|
||||
}
|
||||
|
||||
val successState = state as SourcesFilterScreenModel.State.Success
|
||||
val successState = state as MangaSourcesFilterScreenModel.State.Success
|
||||
|
||||
MangaSourcesFilterScreen(
|
||||
navigateUp = navigator::pop,
|
||||
|
|
|
@ -17,12 +17,12 @@ import uy.kohesive.injekt.Injekt
|
|||
import uy.kohesive.injekt.api.get
|
||||
import java.util.SortedMap
|
||||
|
||||
class SourcesFilterScreenModel(
|
||||
class MangaSourcesFilterScreenModel(
|
||||
private val preferences: SourcePreferences = Injekt.get(),
|
||||
private val getLanguagesWithSources: GetLanguagesWithMangaSources = Injekt.get(),
|
||||
private val toggleSource: ToggleMangaSource = Injekt.get(),
|
||||
private val toggleLanguage: ToggleLanguage = Injekt.get(),
|
||||
) : StateScreenModel<SourcesFilterScreenModel.State>(State.Loading) {
|
||||
) : StateScreenModel<MangaSourcesFilterScreenModel.State>(State.Loading) {
|
||||
|
||||
init {
|
||||
coroutineScope.launch {
|
||||
|
|
|
@ -38,7 +38,7 @@ import eu.kanade.tachiyomi.R
|
|||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.manga.isLocalOrStub
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.migration.search.MigrateSearchScreen
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.migration.search.MigrateMangaSearchScreen
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.source.browse.BrowseMangaSourceScreen
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.source.globalsearch.GlobalMangaSearchScreen
|
||||
import eu.kanade.tachiyomi.ui.category.CategoriesTab
|
||||
|
@ -131,7 +131,7 @@ class MangaScreen(
|
|||
onDownloadActionClicked = screenModel::runDownloadAction.takeIf { !successState.source.isLocalOrStub() },
|
||||
onEditCategoryClicked = screenModel::showChangeCategoryDialog.takeIf { successState.manga.favorite },
|
||||
onEditFetchIntervalClicked = screenModel::showSetMangaFetchIntervalDialog.takeIf { screenModel.isUpdateIntervalEnabled && successState.manga.favorite },
|
||||
onMigrateClicked = { navigator.push(MigrateSearchScreen(successState.manga.id)) }.takeIf { successState.manga.favorite },
|
||||
onMigrateClicked = { navigator.push(MigrateMangaSearchScreen(successState.manga.id)) }.takeIf { successState.manga.favorite },
|
||||
onMultiBookmarkClicked = screenModel::bookmarkChapters,
|
||||
onMultiMarkAsReadClicked = screenModel::markChaptersRead,
|
||||
onMarkPreviousAsReadClicked = screenModel::markPreviousChapterRead,
|
||||
|
|
Loading…
Reference in a new issue