mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-22 12:48:15 +03:00
parent
26145b9245
commit
1c6a18b14a
90 changed files with 351 additions and 292 deletions
|
@ -1,24 +0,0 @@
|
|||
package eu.kanade.data.source.anime
|
||||
|
||||
import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import tachiyomi.domain.source.anime.model.AnimeSource
|
||||
import tachiyomi.domain.source.anime.model.AnimeSourceData
|
||||
|
||||
val animeSourceMapper: (eu.kanade.tachiyomi.animesource.AnimeSource) -> AnimeSource = { source ->
|
||||
AnimeSource(
|
||||
source.id,
|
||||
source.lang,
|
||||
source.name,
|
||||
supportsLatest = false,
|
||||
isStub = source is AnimeSourceManager.StubAnimeSource,
|
||||
)
|
||||
}
|
||||
|
||||
val catalogueAnimeSourceMapper: (AnimeCatalogueSource) -> AnimeSource = { source ->
|
||||
animeSourceMapper(source).copy(supportsLatest = source.supportsLatest)
|
||||
}
|
||||
|
||||
val animeSourceDataMapper: (Long, String, String) -> AnimeSourceData = { id, lang, name ->
|
||||
AnimeSourceData(id, lang, name)
|
||||
}
|
|
@ -3,7 +3,7 @@ package eu.kanade.data.source.anime
|
|||
import eu.kanade.domain.source.anime.repository.AnimeSourceRepository
|
||||
import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.map
|
||||
import tachiyomi.data.handlers.anime.AnimeDatabaseHandler
|
||||
|
@ -11,8 +11,11 @@ import tachiyomi.data.source.anime.AnimeSourceLatestPagingSource
|
|||
import tachiyomi.data.source.anime.AnimeSourcePagingSourceType
|
||||
import tachiyomi.data.source.anime.AnimeSourcePopularPagingSource
|
||||
import tachiyomi.data.source.anime.AnimeSourceSearchPagingSource
|
||||
import tachiyomi.data.source.anime.animeSourceMapper
|
||||
import tachiyomi.domain.source.anime.model.AnimeSource
|
||||
import tachiyomi.domain.source.anime.model.AnimeSourceWithCount
|
||||
import tachiyomi.domain.source.anime.model.StubAnimeSource
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.source.local.entries.anime.LocalAnimeSource
|
||||
|
||||
class AnimeSourceRepositoryImpl(
|
||||
|
@ -22,13 +25,19 @@ class AnimeSourceRepositoryImpl(
|
|||
|
||||
override fun getAnimeSources(): Flow<List<AnimeSource>> {
|
||||
return sourceManager.catalogueSources.map { sources ->
|
||||
sources.map(catalogueAnimeSourceMapper)
|
||||
sources.map {
|
||||
animeSourceMapper(it).copy(
|
||||
supportsLatest = it.supportsLatest,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getOnlineAnimeSources(): Flow<List<AnimeSource>> {
|
||||
return sourceManager.onlineSources.map { sources ->
|
||||
sources.map(animeSourceMapper)
|
||||
return sourceManager.catalogueSources.map { sources ->
|
||||
sources
|
||||
.filterIsInstance<AnimeHttpSource>()
|
||||
.map(animeSourceMapper)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,8 +47,11 @@ class AnimeSourceRepositoryImpl(
|
|||
sourceIdsWithCount
|
||||
.filterNot { it.source == LocalAnimeSource.ID }
|
||||
.map { (sourceId, count) ->
|
||||
val source = animeSourceMapper(sourceManager.getOrStub(sourceId))
|
||||
source to count
|
||||
val source = sourceManager.getOrStub(sourceId)
|
||||
val domainSource = animeSourceMapper(source).copy(
|
||||
isStub = source is StubAnimeSource,
|
||||
)
|
||||
domainSource to count
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +61,10 @@ class AnimeSourceRepositoryImpl(
|
|||
return sourceIdWithNonLibraryAnime.map { sourceId ->
|
||||
sourceId.map { (sourceId, count) ->
|
||||
val source = sourceManager.getOrStub(sourceId)
|
||||
AnimeSourceWithCount(animeSourceMapper(source), count)
|
||||
val domainSource = animeSourceMapper(source).copy(
|
||||
isStub = source is StubAnimeSource,
|
||||
)
|
||||
AnimeSourceWithCount(domainSource, count)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
package eu.kanade.data.source.manga
|
||||
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import tachiyomi.domain.source.manga.model.MangaSourceData
|
||||
import tachiyomi.domain.source.manga.model.Source
|
||||
|
||||
val mangaSourceMapper: (eu.kanade.tachiyomi.source.MangaSource) -> Source = { source ->
|
||||
Source(
|
||||
source.id,
|
||||
source.lang,
|
||||
source.name,
|
||||
supportsLatest = false,
|
||||
isStub = source is MangaSourceManager.StubMangaSource,
|
||||
)
|
||||
}
|
||||
|
||||
val catalogueMangaSourceMapper: (CatalogueSource) -> Source = { source ->
|
||||
mangaSourceMapper(source).copy(supportsLatest = source.supportsLatest)
|
||||
}
|
||||
|
||||
val mangaSourceDataMapper: (Long, String, String) -> MangaSourceData = { id, lang, name ->
|
||||
MangaSourceData(id, lang, name)
|
||||
}
|
|
@ -2,8 +2,8 @@ package eu.kanade.data.source.manga
|
|||
|
||||
import eu.kanade.domain.source.manga.repository.MangaSourceRepository
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.map
|
||||
import tachiyomi.data.handlers.manga.MangaDatabaseHandler
|
||||
|
@ -11,8 +11,11 @@ import tachiyomi.data.source.manga.SourceLatestPagingSource
|
|||
import tachiyomi.data.source.manga.SourcePagingSourceType
|
||||
import tachiyomi.data.source.manga.SourcePopularPagingSource
|
||||
import tachiyomi.data.source.manga.SourceSearchPagingSource
|
||||
import tachiyomi.data.source.manga.mangaSourceMapper
|
||||
import tachiyomi.domain.source.manga.model.MangaSourceWithCount
|
||||
import tachiyomi.domain.source.manga.model.Source
|
||||
import tachiyomi.domain.source.manga.model.StubMangaSource
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.source.local.entries.manga.LocalMangaSource
|
||||
|
||||
class MangaSourceRepositoryImpl(
|
||||
|
@ -22,13 +25,19 @@ class MangaSourceRepositoryImpl(
|
|||
|
||||
override fun getMangaSources(): Flow<List<Source>> {
|
||||
return sourceManager.catalogueSources.map { sources ->
|
||||
sources.map(catalogueMangaSourceMapper)
|
||||
sources.map {
|
||||
mangaSourceMapper(it).copy(
|
||||
supportsLatest = it.supportsLatest,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getOnlineMangaSources(): Flow<List<Source>> {
|
||||
return sourceManager.onlineSources.map { sources ->
|
||||
sources.map(mangaSourceMapper)
|
||||
return sourceManager.catalogueSources.map { sources ->
|
||||
sources
|
||||
.filterIsInstance<HttpSource>()
|
||||
.map(mangaSourceMapper)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,8 +47,11 @@ class MangaSourceRepositoryImpl(
|
|||
sourceIdsWithCount
|
||||
.filterNot { it.source == LocalMangaSource.ID }
|
||||
.map { (sourceId, count) ->
|
||||
val source = mangaSourceMapper(sourceManager.getOrStub(sourceId))
|
||||
source to count
|
||||
val source = sourceManager.getOrStub(sourceId)
|
||||
val domainSource = mangaSourceMapper(source).copy(
|
||||
isStub = source is StubMangaSource,
|
||||
)
|
||||
domainSource to count
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +61,10 @@ class MangaSourceRepositoryImpl(
|
|||
return sourceIdWithNonLibraryManga.map { sourceId ->
|
||||
sourceId.map { (sourceId, count) ->
|
||||
val source = sourceManager.getOrStub(sourceId)
|
||||
MangaSourceWithCount(mangaSourceMapper(source), count)
|
||||
val domainSource = mangaSourceMapper(source).copy(
|
||||
isStub = source is StubMangaSource,
|
||||
)
|
||||
MangaSourceWithCount(domainSource, count)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package eu.kanade.domain.download.anime.interactor
|
||||
|
||||
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import tachiyomi.core.util.lang.withNonCancellableContext
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
|
||||
class DeleteAnimeDownload(
|
||||
private val sourceManager: AnimeSourceManager,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package eu.kanade.domain.download.manga.interactor
|
||||
|
||||
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import tachiyomi.core.util.lang.withNonCancellableContext
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
|
||||
class DeleteChapterDownload(
|
||||
private val sourceManager: MangaSourceManager,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package eu.kanade.domain.items.chapter.interactor
|
||||
|
||||
import eu.kanade.domain.download.manga.interactor.DeleteChapterDownload
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import logcat.LogPriority
|
||||
import tachiyomi.core.util.lang.withNonCancellableContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.entries.manga.repository.MangaRepository
|
||||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package eu.kanade.domain.items.episode.interactor
|
||||
|
||||
import eu.kanade.domain.download.anime.interactor.DeleteAnimeDownload
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import logcat.LogPriority
|
||||
import tachiyomi.core.util.lang.withNonCancellableContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.entries.anime.repository.AnimeRepository
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
|
|
|
@ -6,6 +6,7 @@ import eu.kanade.domain.source.service.SourcePreferences
|
|||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.combine
|
||||
import tachiyomi.domain.source.anime.model.AnimeSource
|
||||
import tachiyomi.source.local.entries.anime.LocalAnimeSource
|
||||
import java.text.Collator
|
||||
import java.util.Collections
|
||||
import java.util.Locale
|
||||
|
@ -21,7 +22,9 @@ class GetAnimeSourcesWithFavoriteCount(
|
|||
preferences.migrationSortingMode().changes(),
|
||||
repository.getAnimeSourcesWithFavoriteCount(),
|
||||
) { direction, mode, list ->
|
||||
list.sortedWith(sortFn(direction, mode))
|
||||
list
|
||||
.filterNot { it.first.id == LocalAnimeSource.ID }
|
||||
.sortedWith(sortFn(direction, mode))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import eu.kanade.domain.source.service.SourcePreferences
|
|||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.combine
|
||||
import tachiyomi.domain.source.manga.model.Source
|
||||
import tachiyomi.source.local.entries.manga.LocalMangaSource
|
||||
import java.text.Collator
|
||||
import java.util.Collections
|
||||
import java.util.Locale
|
||||
|
@ -21,7 +22,9 @@ class GetMangaSourcesWithFavoriteCount(
|
|||
preferences.migrationSortingMode().changes(),
|
||||
repository.getMangaSourcesWithFavoriteCount(),
|
||||
) { direction, mode, list ->
|
||||
list.sortedWith(sortFn(direction, mode))
|
||||
list
|
||||
.filterNot { it.first.id == LocalMangaSource.ID }
|
||||
.sortedWith(sortFn(direction, mode))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.paging.LoadState
|
||||
import androidx.paging.compose.LazyPagingItems
|
||||
import eu.kanade.presentation.browse.anime.components.BrowseAnimeSourceComfortableGrid
|
||||
|
@ -22,11 +23,11 @@ import eu.kanade.presentation.browse.anime.components.BrowseAnimeSourceList
|
|||
import eu.kanade.presentation.components.AppBar
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.model.NoEpisodesException
|
||||
import tachiyomi.domain.library.model.LibraryDisplayMode
|
||||
import tachiyomi.domain.source.anime.model.StubAnimeSource
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.screens.EmptyScreen
|
||||
import tachiyomi.presentation.core.screens.EmptyScreenAction
|
||||
|
@ -147,7 +148,7 @@ fun BrowseAnimeSourceContent(
|
|||
|
||||
@Composable
|
||||
fun MissingSourceScreen(
|
||||
source: AnimeSourceManager.StubAnimeSource,
|
||||
source: StubAnimeSource,
|
||||
navigateUp: () -> Unit,
|
||||
) {
|
||||
Scaffold(
|
||||
|
@ -160,7 +161,7 @@ fun MissingSourceScreen(
|
|||
},
|
||||
) { paddingValues ->
|
||||
EmptyScreen(
|
||||
message = source.getSourceNotInstalledException().message!!,
|
||||
message = stringResource(R.string.source_not_installed, source.toString()),
|
||||
modifier = Modifier.padding(paddingValues),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.paging.LoadState
|
||||
import androidx.paging.compose.LazyPagingItems
|
||||
import eu.kanade.presentation.browse.manga.components.BrowseMangaSourceComfortableGrid
|
||||
|
@ -22,11 +23,11 @@ import eu.kanade.presentation.browse.manga.components.BrowseMangaSourceList
|
|||
import eu.kanade.presentation.components.AppBar
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.model.NoChaptersException
|
||||
import tachiyomi.domain.library.model.LibraryDisplayMode
|
||||
import tachiyomi.domain.source.manga.model.StubMangaSource
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.screens.EmptyScreen
|
||||
import tachiyomi.presentation.core.screens.EmptyScreenAction
|
||||
|
@ -147,7 +148,7 @@ fun BrowseSourceContent(
|
|||
|
||||
@Composable
|
||||
fun MissingSourceScreen(
|
||||
source: MangaSourceManager.StubMangaSource,
|
||||
source: StubMangaSource,
|
||||
navigateUp: () -> Unit,
|
||||
) {
|
||||
Scaffold(
|
||||
|
@ -160,7 +161,7 @@ fun MissingSourceScreen(
|
|||
},
|
||||
) { paddingValues ->
|
||||
EmptyScreen(
|
||||
message = source.getSourceNotInstalledException().message!!,
|
||||
message = stringResource(R.string.source_not_installed, source.toString()),
|
||||
modifier = Modifier.padding(paddingValues),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
|||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.presentation.core.components.material.IconButtonTokens
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ import eu.kanade.presentation.entries.anime.components.EpisodeDownloadAction
|
|||
import eu.kanade.presentation.entries.anime.components.ExpandableAnimeDescription
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.anime.model.AnimeDownload
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.anime.getNameForAnimeInfo
|
||||
import eu.kanade.tachiyomi.ui.entries.anime.AnimeScreenState
|
||||
import eu.kanade.tachiyomi.ui.entries.anime.EpisodeItem
|
||||
|
@ -71,6 +70,7 @@ import eu.kanade.tachiyomi.util.lang.toRelativeString
|
|||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.source.anime.model.StubAnimeSource
|
||||
import tachiyomi.presentation.core.components.LazyColumn
|
||||
import tachiyomi.presentation.core.components.TwoPanelBox
|
||||
import tachiyomi.presentation.core.components.VerticalFastScroller
|
||||
|
@ -369,7 +369,7 @@ private fun AnimeScreenSmallImpl(
|
|||
author = state.anime.author,
|
||||
artist = state.anime.artist,
|
||||
sourceName = remember { state.source.getNameForAnimeInfo() },
|
||||
isStubSource = remember { state.source is AnimeSourceManager.StubAnimeSource },
|
||||
isStubSource = remember { state.source is StubAnimeSource },
|
||||
coverDataProvider = { state.anime },
|
||||
status = state.anime.status,
|
||||
onCoverClick = onCoverClicked,
|
||||
|
@ -586,7 +586,7 @@ fun AnimeScreenLargeImpl(
|
|||
author = state.anime.author,
|
||||
artist = state.anime.artist,
|
||||
sourceName = remember { state.source.getNameForAnimeInfo() },
|
||||
isStubSource = remember { state.source is AnimeSourceManager.StubAnimeSource },
|
||||
isStubSource = remember { state.source is StubAnimeSource },
|
||||
coverDataProvider = { state.anime },
|
||||
status = state.anime.status,
|
||||
onCoverClick = onCoverClicked,
|
||||
|
|
|
@ -40,7 +40,6 @@ import eu.kanade.presentation.util.Screen
|
|||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.ui.player.loader.EpisodeLoader
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
|
@ -55,6 +54,7 @@ import tachiyomi.domain.entries.anime.interactor.GetAnime
|
|||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.interactor.GetEpisode
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import tachiyomi.presentation.core.screens.LoadingScreen
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -60,7 +60,6 @@ import eu.kanade.presentation.entries.manga.components.MangaChapterListItem
|
|||
import eu.kanade.presentation.entries.manga.components.MangaInfoBox
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.manga.model.MangaDownload
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.getNameForMangaInfo
|
||||
import eu.kanade.tachiyomi.ui.entries.manga.ChapterItem
|
||||
import eu.kanade.tachiyomi.ui.entries.manga.MangaScreenState
|
||||
|
@ -69,6 +68,7 @@ import eu.kanade.tachiyomi.util.lang.toRelativeString
|
|||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
import tachiyomi.domain.source.manga.model.StubMangaSource
|
||||
import tachiyomi.presentation.core.components.LazyColumn
|
||||
import tachiyomi.presentation.core.components.TwoPanelBox
|
||||
import tachiyomi.presentation.core.components.VerticalFastScroller
|
||||
|
@ -354,7 +354,7 @@ private fun MangaScreenSmallImpl(
|
|||
author = state.manga.author,
|
||||
artist = state.manga.artist,
|
||||
sourceName = remember { state.source.getNameForMangaInfo() },
|
||||
isStubSource = remember { state.source is MangaSourceManager.StubMangaSource },
|
||||
isStubSource = remember { state.source is StubMangaSource },
|
||||
coverDataProvider = { state.manga },
|
||||
status = state.manga.status,
|
||||
onCoverClick = onCoverClicked,
|
||||
|
@ -567,7 +567,7 @@ fun MangaScreenLargeImpl(
|
|||
author = state.manga.author,
|
||||
artist = state.manga.artist,
|
||||
sourceName = remember { state.source.getNameForMangaInfo() },
|
||||
isStubSource = remember { state.source is MangaSourceManager.StubMangaSource },
|
||||
isStubSource = remember { state.source is StubMangaSource },
|
||||
coverDataProvider = { state.manga },
|
||||
status = state.manga.status,
|
||||
onCoverClick = onCoverClicked,
|
||||
|
|
|
@ -36,7 +36,6 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.core.net.toUri
|
||||
import com.hippo.unifile.UniFile
|
||||
import eu.kanade.domain.backup.service.BackupPreferences
|
||||
import eu.kanade.presentation.extensions.RequestStoragePermission
|
||||
import eu.kanade.presentation.more.settings.Preference
|
||||
import eu.kanade.presentation.util.collectAsState
|
||||
|
@ -58,6 +57,7 @@ import eu.kanade.tachiyomi.util.system.DeviceUtil
|
|||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.coroutines.launch
|
||||
import tachiyomi.domain.backup.service.BackupPreferences
|
||||
import tachiyomi.presentation.core.components.ScrollbarLazyColumn
|
||||
import tachiyomi.presentation.core.components.material.Divider
|
||||
import tachiyomi.presentation.core.util.isScrolledToEnd
|
||||
|
|
|
@ -20,7 +20,6 @@ import androidx.compose.ui.util.fastMap
|
|||
import androidx.core.net.toUri
|
||||
import com.hippo.unifile.UniFile
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.presentation.category.visualName
|
||||
import eu.kanade.presentation.more.settings.Preference
|
||||
import eu.kanade.presentation.more.settings.widget.TriStateListDialog
|
||||
|
@ -30,6 +29,7 @@ import kotlinx.coroutines.runBlocking
|
|||
import tachiyomi.domain.category.anime.interactor.GetAnimeCategories
|
||||
import tachiyomi.domain.category.manga.interactor.GetMangaCategories
|
||||
import tachiyomi.domain.category.model.Category
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.io.File
|
||||
|
|
|
@ -52,11 +52,11 @@ import eu.kanade.tachiyomi.data.track.bangumi.BangumiApi
|
|||
import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeListApi
|
||||
import eu.kanade.tachiyomi.data.track.shikimori.ShikimoriApi
|
||||
import eu.kanade.tachiyomi.data.track.simkl.SimklApi
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.core.util.lang.withUIContext
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -10,9 +10,7 @@ import data.History
|
|||
import data.Mangas
|
||||
import dataanime.Animehistory
|
||||
import dataanime.Animes
|
||||
import eu.kanade.domain.backup.service.BackupPreferences
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.library.service.LibraryPreferences
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.domain.track.anime.store.DelayedAnimeTrackingStore
|
||||
|
@ -38,8 +36,8 @@ import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
|
|||
import eu.kanade.tachiyomi.network.JavaScriptEngine
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.network.NetworkPreferences
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.anime.AndroidAnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.AndroidMangaSourceManager
|
||||
import eu.kanade.tachiyomi.ui.player.ExternalIntents
|
||||
import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
|
||||
|
@ -61,6 +59,10 @@ import tachiyomi.data.handlers.manga.AndroidMangaDatabaseHandler
|
|||
import tachiyomi.data.handlers.manga.MangaDatabaseHandler
|
||||
import tachiyomi.data.listOfStringsAdapter
|
||||
import tachiyomi.data.updateStrategyAdapter
|
||||
import tachiyomi.domain.backup.service.BackupPreferences
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.mi.data.AnimeDatabase
|
||||
import tachiyomi.source.local.image.anime.LocalAnimeCoverManager
|
||||
import tachiyomi.source.local.image.manga.LocalMangaCoverManager
|
||||
|
@ -182,8 +184,8 @@ class AppModule(val app: Application) : InjektModule {
|
|||
addSingletonFactory { NetworkHelper(app, get()) }
|
||||
addSingletonFactory { JavaScriptEngine(app) }
|
||||
|
||||
addSingletonFactory { MangaSourceManager(app, get(), get()) }
|
||||
addSingletonFactory { AnimeSourceManager(app, get(), get()) }
|
||||
addSingletonFactory<MangaSourceManager> { AndroidMangaSourceManager(app, get(), get()) }
|
||||
addSingletonFactory<AnimeSourceManager> { AndroidAnimeSourceManager(app, get(), get()) }
|
||||
|
||||
addSingletonFactory { MangaExtensionManager(app) }
|
||||
addSingletonFactory { AnimeExtensionManager(app) }
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.content.Context
|
|||
import androidx.core.content.edit
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.work.WorkManager
|
||||
import eu.kanade.domain.backup.service.BackupPreferences
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.library.service.LibraryPreferences
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
|
@ -27,6 +26,7 @@ import eu.kanade.tachiyomi.util.system.DeviceUtil
|
|||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import tachiyomi.core.preference.PreferenceStore
|
||||
import tachiyomi.core.preference.getEnum
|
||||
import tachiyomi.domain.backup.service.BackupPreferences
|
||||
import tachiyomi.domain.entries.TriStateFilter
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -14,11 +14,11 @@ import androidx.work.WorkManager
|
|||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import com.hippo.unifile.UniFile
|
||||
import eu.kanade.domain.backup.service.BackupPreferences
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.util.system.notificationManager
|
||||
import logcat.LogPriority
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.backup.service.BackupPreferences
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
|
|
@ -4,9 +4,9 @@ import android.content.Context
|
|||
import android.net.Uri
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.util.BackupUtil
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import data.Manga_sync
|
|||
import data.Mangas
|
||||
import dataanime.Anime_sync
|
||||
import dataanime.Animes
|
||||
import eu.kanade.domain.backup.service.BackupPreferences
|
||||
import eu.kanade.domain.library.service.LibraryPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.backup.BackupConst.BACKUP_CATEGORY
|
||||
|
@ -59,10 +58,8 @@ import eu.kanade.tachiyomi.data.database.models.manga.Manga
|
|||
import eu.kanade.tachiyomi.data.database.models.manga.MangaTrack
|
||||
import eu.kanade.tachiyomi.extension.anime.AnimeExtensionManager
|
||||
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.anime.getPreferenceKey
|
||||
import eu.kanade.tachiyomi.source.anime.model.copyFrom
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.getPreferenceKey
|
||||
import eu.kanade.tachiyomi.source.manga.model.copyFrom
|
||||
import eu.kanade.tachiyomi.util.system.hasPermission
|
||||
|
@ -76,6 +73,7 @@ import tachiyomi.core.util.system.logcat
|
|||
import tachiyomi.data.handlers.anime.AnimeDatabaseHandler
|
||||
import tachiyomi.data.handlers.manga.MangaDatabaseHandler
|
||||
import tachiyomi.data.updateStrategyAdapter
|
||||
import tachiyomi.domain.backup.service.BackupPreferences
|
||||
import tachiyomi.domain.category.anime.interactor.GetAnimeCategories
|
||||
import tachiyomi.domain.category.manga.interactor.GetMangaCategories
|
||||
import tachiyomi.domain.category.model.Category
|
||||
|
@ -83,6 +81,8 @@ import tachiyomi.domain.entries.anime.interactor.GetAnimeFavorites
|
|||
import tachiyomi.domain.entries.manga.interactor.GetMangaFavorites
|
||||
import tachiyomi.domain.history.anime.model.AnimeHistoryUpdate
|
||||
import tachiyomi.domain.history.manga.model.MangaHistoryUpdate
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.io.File
|
||||
|
|
|
@ -15,7 +15,6 @@ import eu.kanade.tachiyomi.data.cache.AnimeCoverCache
|
|||
import eu.kanade.tachiyomi.data.coil.AnimeCoverFetcher.Companion.USE_CUSTOM_COVER
|
||||
import eu.kanade.tachiyomi.data.database.models.anime.Anime
|
||||
import eu.kanade.tachiyomi.network.await
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import logcat.LogPriority
|
||||
import okhttp3.CacheControl
|
||||
import okhttp3.Call
|
||||
|
@ -28,6 +27,7 @@ import okio.buffer
|
|||
import okio.sink
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.entries.anime.model.AnimeCover
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.io.File
|
||||
import tachiyomi.domain.entries.anime.model.Anime as DomainAnime
|
||||
|
|
|
@ -14,7 +14,6 @@ import eu.kanade.tachiyomi.data.cache.MangaCoverCache
|
|||
import eu.kanade.tachiyomi.data.coil.MangaCoverFetcher.Companion.USE_CUSTOM_COVER
|
||||
import eu.kanade.tachiyomi.data.database.models.manga.Manga
|
||||
import eu.kanade.tachiyomi.network.await
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import logcat.LogPriority
|
||||
import okhttp3.CacheControl
|
||||
|
@ -28,6 +27,7 @@ import okio.buffer
|
|||
import okio.sink
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.entries.manga.model.MangaCover
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.io.File
|
||||
import tachiyomi.domain.entries.manga.model.Manga as DomainManga
|
||||
|
|
|
@ -4,10 +4,8 @@ import android.content.Context
|
|||
import androidx.core.net.toUri
|
||||
import com.hippo.unifile.UniFile
|
||||
import eu.kanade.core.util.mapNotNullKeys
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.extension.anime.AnimeExtensionManager
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -30,8 +28,10 @@ import logcat.LogPriority
|
|||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.core.util.lang.launchNonCancellable
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package eu.kanade.tachiyomi.data.download.anime
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.data.download.anime.model.AnimeDownload
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.asFlow
|
||||
import kotlinx.coroutines.flow.drop
|
||||
|
@ -21,8 +19,10 @@ import rx.Observable
|
|||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.category.anime.interactor.GetAnimeCategories
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.download.anime
|
|||
import android.content.Context
|
||||
import androidx.core.net.toUri
|
||||
import com.hippo.unifile.UniFile
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.util.storage.DiskUtil
|
||||
|
@ -12,6 +11,7 @@ import kotlinx.coroutines.flow.launchIn
|
|||
import kotlinx.coroutines.flow.onEach
|
||||
import logcat.LogPriority
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.os.IBinder
|
|||
import android.os.PowerManager
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.content.ContextCompat
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.util.system.acquireWakeLock
|
||||
|
@ -31,6 +30,7 @@ import logcat.LogPriority
|
|||
import ru.beryukhov.reactivenetwork.ReactiveNetwork
|
||||
import tachiyomi.core.util.lang.withUIContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.content.Context
|
|||
import androidx.core.content.edit
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.data.download.anime.model.AnimeDownload
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.decodeFromString
|
||||
|
@ -13,6 +12,7 @@ import kotlinx.serialization.json.Json
|
|||
import tachiyomi.domain.entries.anime.interactor.GetAnime
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.interactor.GetEpisode
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import com.arthenica.ffmpegkit.SessionState
|
|||
import com.arthenica.ffmpegkit.StatisticsCallback
|
||||
import com.hippo.unifile.UniFile
|
||||
import com.jakewharton.rxrelay.PublishRelay
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.items.episode.model.toSEpisode
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
|
@ -25,7 +24,6 @@ import eu.kanade.tachiyomi.data.download.anime.model.AnimeDownload
|
|||
import eu.kanade.tachiyomi.data.library.anime.AnimeLibraryUpdateNotifier
|
||||
import eu.kanade.tachiyomi.data.notification.NotificationHandler
|
||||
import eu.kanade.tachiyomi.source.UnmeteredSource
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.util.storage.DiskUtil
|
||||
import eu.kanade.tachiyomi.util.storage.saveTo
|
||||
import eu.kanade.tachiyomi.util.storage.toFFmpegString
|
||||
|
@ -45,8 +43,10 @@ import tachiyomi.core.util.lang.launchNow
|
|||
import tachiyomi.core.util.lang.withUIContext
|
||||
import tachiyomi.core.util.system.ImageUtil
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
|
|
@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.data.download.anime.model
|
|||
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
|
@ -16,6 +15,7 @@ import tachiyomi.domain.entries.anime.interactor.GetAnime
|
|||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.items.episode.interactor.GetEpisode
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -4,10 +4,8 @@ import android.content.Context
|
|||
import androidx.core.net.toUri
|
||||
import com.hippo.unifile.UniFile
|
||||
import eu.kanade.core.util.mapNotNullKeys
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -30,8 +28,10 @@ import logcat.LogPriority
|
|||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.core.util.lang.launchNonCancellable
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package eu.kanade.tachiyomi.data.download.manga
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.manga.model.MangaDownload
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.asFlow
|
||||
|
@ -20,8 +18,10 @@ import logcat.LogPriority
|
|||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.category.manga.interactor.GetMangaCategories
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.download.manga
|
|||
import android.content.Context
|
||||
import androidx.core.net.toUri
|
||||
import com.hippo.unifile.UniFile
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.util.storage.DiskUtil
|
||||
|
@ -12,6 +11,7 @@ import kotlinx.coroutines.flow.launchIn
|
|||
import kotlinx.coroutines.flow.onEach
|
||||
import logcat.LogPriority
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -8,7 +8,6 @@ import android.os.IBinder
|
|||
import android.os.PowerManager
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.content.ContextCompat
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.util.system.acquireWakeLock
|
||||
|
@ -30,6 +29,7 @@ import logcat.LogPriority
|
|||
import ru.beryukhov.reactivenetwork.ReactiveNetwork
|
||||
import tachiyomi.core.util.lang.withUIContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.download.manga
|
|||
import android.content.Context
|
||||
import androidx.core.content.edit
|
||||
import eu.kanade.tachiyomi.data.download.manga.model.MangaDownload
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -13,6 +12,7 @@ import kotlinx.serialization.json.Json
|
|||
import tachiyomi.domain.entries.manga.interactor.GetManga
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.interactor.GetChapter
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.download.manga
|
|||
import android.content.Context
|
||||
import com.hippo.unifile.UniFile
|
||||
import com.jakewharton.rxrelay.PublishRelay
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.manga.model.getComicInfo
|
||||
import eu.kanade.domain.items.chapter.model.toSChapter
|
||||
import eu.kanade.tachiyomi.R
|
||||
|
@ -12,7 +11,6 @@ import eu.kanade.tachiyomi.data.download.manga.model.MangaDownload
|
|||
import eu.kanade.tachiyomi.data.library.manga.MangaLibraryUpdateNotifier
|
||||
import eu.kanade.tachiyomi.data.notification.NotificationHandler
|
||||
import eu.kanade.tachiyomi.source.UnmeteredSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.util.storage.DiskUtil
|
||||
|
@ -48,8 +46,10 @@ import tachiyomi.core.util.lang.withIOContext
|
|||
import tachiyomi.core.util.lang.withUIContext
|
||||
import tachiyomi.core.util.system.ImageUtil
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.io.BufferedOutputStream
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package eu.kanade.tachiyomi.data.download.manga.model
|
||||
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import kotlinx.coroutines.delay
|
||||
|
@ -15,6 +14,7 @@ import tachiyomi.domain.entries.manga.interactor.GetManga
|
|||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.items.chapter.interactor.GetChapter
|
||||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import androidx.work.WorkManager
|
|||
import androidx.work.WorkQuery
|
||||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.anime.interactor.UpdateAnime
|
||||
import eu.kanade.domain.entries.anime.model.copyFrom
|
||||
import eu.kanade.domain.entries.anime.model.toSAnime
|
||||
|
@ -40,7 +39,6 @@ import eu.kanade.tachiyomi.data.track.EnhancedAnimeTrackService
|
|||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.source.UnmeteredSource
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
||||
import eu.kanade.tachiyomi.util.prepUpdateCover
|
||||
import eu.kanade.tachiyomi.util.shouldDownloadNewEpisodes
|
||||
|
@ -64,6 +62,7 @@ import tachiyomi.core.util.lang.withIOContext
|
|||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.category.anime.interactor.GetAnimeCategories
|
||||
import tachiyomi.domain.category.model.Category
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnime
|
||||
import tachiyomi.domain.entries.anime.interactor.GetLibraryAnime
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
|
@ -72,6 +71,8 @@ import tachiyomi.domain.items.episode.interactor.GetEpisodeByAnimeId
|
|||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.items.episode.model.NoEpisodesException
|
||||
import tachiyomi.domain.library.anime.LibraryAnime
|
||||
import tachiyomi.domain.source.anime.model.AnimeSourceNotInstalledException
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.track.anime.interactor.GetAnimeTracks
|
||||
import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
@ -284,7 +285,7 @@ class AnimeLibraryUpdateJob(private val context: Context, workerParams: WorkerPa
|
|||
val errorMessage = when (e) {
|
||||
is NoEpisodesException -> context.getString(R.string.no_chapters_error)
|
||||
// failedUpdates will already have the source, don't need to copy it into the message
|
||||
is AnimeSourceManager.AnimeSourceNotInstalledException -> context.getString(R.string.loader_not_implemented_error)
|
||||
is AnimeSourceNotInstalledException -> context.getString(R.string.loader_not_implemented_error)
|
||||
else -> e.message
|
||||
}
|
||||
failedUpdates.add(anime to errorMessage)
|
||||
|
|
|
@ -15,7 +15,6 @@ import androidx.work.WorkManager
|
|||
import androidx.work.WorkQuery
|
||||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.manga.interactor.UpdateManga
|
||||
import eu.kanade.domain.entries.manga.model.copyFrom
|
||||
import eu.kanade.domain.entries.manga.model.toSManga
|
||||
|
@ -39,7 +38,6 @@ import eu.kanade.tachiyomi.data.track.EnhancedMangaTrackService
|
|||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.source.UnmeteredSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
||||
import eu.kanade.tachiyomi.util.prepUpdateCover
|
||||
|
@ -64,6 +62,7 @@ import tachiyomi.core.util.lang.withIOContext
|
|||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.category.manga.interactor.GetMangaCategories
|
||||
import tachiyomi.domain.category.model.Category
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.manga.interactor.GetLibraryManga
|
||||
import tachiyomi.domain.entries.manga.interactor.GetManga
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
|
@ -72,6 +71,8 @@ import tachiyomi.domain.items.chapter.interactor.GetChapterByMangaId
|
|||
import tachiyomi.domain.items.chapter.model.Chapter
|
||||
import tachiyomi.domain.items.chapter.model.NoChaptersException
|
||||
import tachiyomi.domain.library.manga.LibraryManga
|
||||
import tachiyomi.domain.source.manga.model.SourceNotInstalledException
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.domain.track.manga.interactor.GetMangaTracks
|
||||
import tachiyomi.domain.track.manga.interactor.InsertMangaTrack
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
@ -284,7 +285,7 @@ class MangaLibraryUpdateJob(private val context: Context, workerParams: WorkerPa
|
|||
val errorMessage = when (e) {
|
||||
is NoChaptersException -> context.getString(R.string.no_chapters_error)
|
||||
// failedUpdates will already have the source, don't need to copy it into the message
|
||||
is MangaSourceManager.SourceNotInstalledException -> context.getString(R.string.loader_not_implemented_error)
|
||||
is SourceNotInstalledException -> context.getString(R.string.loader_not_implemented_error)
|
||||
else -> e.message
|
||||
}
|
||||
failedUpdates.add(manga to errorMessage)
|
||||
|
|
|
@ -8,7 +8,6 @@ import android.net.Uri
|
|||
import android.os.Build
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.net.toUri
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.core.Constants
|
||||
import eu.kanade.tachiyomi.data.backup.BackupRestoreService
|
||||
|
@ -17,8 +16,6 @@ import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
|
|||
import eu.kanade.tachiyomi.data.library.anime.AnimeLibraryUpdateJob
|
||||
import eu.kanade.tachiyomi.data.library.manga.MangaLibraryUpdateJob
|
||||
import eu.kanade.tachiyomi.data.updater.AppUpdateService
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||
import eu.kanade.tachiyomi.ui.player.PlayerActivity
|
||||
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
||||
|
@ -30,6 +27,7 @@ import eu.kanade.tachiyomi.util.system.toShareIntent
|
|||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnime
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.entries.manga.interactor.GetManga
|
||||
|
@ -42,6 +40,8 @@ import tachiyomi.domain.items.episode.interactor.GetEpisode
|
|||
import tachiyomi.domain.items.episode.interactor.UpdateEpisode
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.items.episode.model.toEpisodeUpdate
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package eu.kanade.tachiyomi.source.anime
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource
|
||||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
|
||||
import eu.kanade.tachiyomi.extension.anime.AnimeExtensionManager
|
||||
|
@ -20,18 +16,20 @@ import kotlinx.coroutines.flow.map
|
|||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import tachiyomi.domain.source.anime.model.AnimeSourceData
|
||||
import tachiyomi.domain.source.anime.model.StubAnimeSource
|
||||
import tachiyomi.domain.source.anime.repository.AnimeSourceDataRepository
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.source.local.entries.anime.LocalAnimeSource
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
class AnimeSourceManager(
|
||||
class AndroidAnimeSourceManager(
|
||||
private val context: Context,
|
||||
private val extensionManager: AnimeExtensionManager,
|
||||
private val sourceRepository: AnimeSourceDataRepository,
|
||||
) {
|
||||
) : AnimeSourceManager {
|
||||
private val downloadManager: AnimeDownloadManager by injectLazy()
|
||||
|
||||
private val scope = CoroutineScope(Job() + Dispatchers.IO)
|
||||
|
@ -40,8 +38,7 @@ class AnimeSourceManager(
|
|||
|
||||
private val stubSourcesMap = ConcurrentHashMap<Long, StubAnimeSource>()
|
||||
|
||||
val catalogueSources: Flow<List<AnimeCatalogueSource>> = sourcesMapFlow.map { it.values.filterIsInstance<AnimeCatalogueSource>() }
|
||||
val onlineSources: Flow<List<AnimeHttpSource>> = catalogueSources.map { it.filterIsInstance<AnimeHttpSource>() }
|
||||
override val catalogueSources: Flow<List<AnimeCatalogueSource>> = sourcesMapFlow.map { it.values.filterIsInstance<AnimeCatalogueSource>() }
|
||||
|
||||
init {
|
||||
scope.launch {
|
||||
|
@ -77,21 +74,21 @@ class AnimeSourceManager(
|
|||
}
|
||||
}
|
||||
|
||||
fun get(sourceKey: Long): AnimeSource? {
|
||||
override fun get(sourceKey: Long): AnimeSource? {
|
||||
return sourcesMapFlow.value[sourceKey]
|
||||
}
|
||||
|
||||
fun getOrStub(sourceKey: Long): AnimeSource {
|
||||
override fun getOrStub(sourceKey: Long): AnimeSource {
|
||||
return sourcesMapFlow.value[sourceKey] ?: stubSourcesMap.getOrPut(sourceKey) {
|
||||
runBlocking { createStubSource(sourceKey) }
|
||||
}
|
||||
}
|
||||
|
||||
fun getOnlineSources() = sourcesMapFlow.value.values.filterIsInstance<AnimeHttpSource>()
|
||||
override fun getOnlineSources() = sourcesMapFlow.value.values.filterIsInstance<AnimeHttpSource>()
|
||||
|
||||
fun getCatalogueSources() = sourcesMapFlow.value.values.filterIsInstance<AnimeCatalogueSource>()
|
||||
override fun getCatalogueSources() = sourcesMapFlow.value.values.filterIsInstance<AnimeCatalogueSource>()
|
||||
|
||||
fun getStubSources(): List<StubAnimeSource> {
|
||||
override fun getStubSources(): List<StubAnimeSource> {
|
||||
val onlineSourceIds = getOnlineSources().map { it.id }
|
||||
return stubSourcesMap.values.filterNot { it.id in onlineSourceIds }
|
||||
}
|
||||
|
@ -117,37 +114,4 @@ class AnimeSourceManager(
|
|||
}
|
||||
return StubAnimeSource(AnimeSourceData(id, "", ""))
|
||||
}
|
||||
|
||||
@Suppress("OverridingDeprecatedMember")
|
||||
inner class StubAnimeSource(private val sourceData: AnimeSourceData) : AnimeSource {
|
||||
|
||||
override val id: Long = sourceData.id
|
||||
|
||||
override val name: String = sourceData.name.ifBlank { id.toString() }
|
||||
|
||||
override val lang: String = sourceData.lang
|
||||
|
||||
override suspend fun getAnimeDetails(anime: SAnime): SAnime {
|
||||
throw getSourceNotInstalledException()
|
||||
}
|
||||
|
||||
override suspend fun getEpisodeList(anime: SAnime): List<SEpisode> {
|
||||
throw getSourceNotInstalledException()
|
||||
}
|
||||
|
||||
override suspend fun getVideoList(episode: SEpisode): List<Video> {
|
||||
throw getSourceNotInstalledException()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return if (sourceData.isMissingInfo.not()) "$name (${lang.uppercase()})" else id.toString()
|
||||
}
|
||||
|
||||
fun getSourceNotInstalledException(): AnimeSourceNotInstalledException {
|
||||
return AnimeSourceNotInstalledException(toString())
|
||||
}
|
||||
}
|
||||
|
||||
inner class AnimeSourceNotInstalledException(sourceString: String) :
|
||||
Exception(context.getString(R.string.source_not_installed, sourceString))
|
||||
}
|
|
@ -5,6 +5,7 @@ import eu.kanade.domain.source.service.SourcePreferences
|
|||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.extension.anime.AnimeExtensionManager
|
||||
import tachiyomi.domain.source.anime.model.AnimeSourceData
|
||||
import tachiyomi.domain.source.anime.model.StubAnimeSource
|
||||
import tachiyomi.source.local.entries.anime.LocalAnimeSource
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
@ -32,4 +33,4 @@ fun AnimeSource.getNameForAnimeInfo(): String {
|
|||
|
||||
fun AnimeSource.isLocal(): Boolean = id == LocalAnimeSource.ID
|
||||
|
||||
fun AnimeSource.isLocalOrStub(): Boolean = isLocal() || this is AnimeSourceManager.StubAnimeSource
|
||||
fun AnimeSource.isLocalOrStub(): Boolean = isLocal() || this is StubAnimeSource
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package eu.kanade.tachiyomi.source.manga
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
|
||||
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -19,20 +15,21 @@ import kotlinx.coroutines.flow.collectLatest
|
|||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import rx.Observable
|
||||
import tachiyomi.domain.source.manga.model.MangaSourceData
|
||||
import tachiyomi.domain.source.manga.model.StubMangaSource
|
||||
import tachiyomi.domain.source.manga.repository.MangaSourceDataRepository
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.source.local.entries.manga.LocalMangaSource
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
class MangaSourceManager(
|
||||
class AndroidMangaSourceManager(
|
||||
private val context: Context,
|
||||
private val extensionManager: MangaExtensionManager,
|
||||
private val sourceRepository: MangaSourceDataRepository,
|
||||
) {
|
||||
) : MangaSourceManager {
|
||||
private val downloadManager: MangaDownloadManager by injectLazy()
|
||||
|
||||
private val scope = CoroutineScope(Job() + Dispatchers.IO)
|
||||
|
@ -41,8 +38,7 @@ class MangaSourceManager(
|
|||
|
||||
private val stubSourcesMap = ConcurrentHashMap<Long, StubMangaSource>()
|
||||
|
||||
val catalogueSources: Flow<List<CatalogueSource>> = sourcesMapFlow.map { it.values.filterIsInstance<CatalogueSource>() }
|
||||
val onlineSources: Flow<List<HttpSource>> = catalogueSources.map { it.filterIsInstance<HttpSource>() }
|
||||
override val catalogueSources: Flow<List<CatalogueSource>> = sourcesMapFlow.map { it.values.filterIsInstance<CatalogueSource>() }
|
||||
|
||||
init {
|
||||
scope.launch {
|
||||
|
@ -78,21 +74,21 @@ class MangaSourceManager(
|
|||
}
|
||||
}
|
||||
|
||||
fun get(sourceKey: Long): MangaSource? {
|
||||
override fun get(sourceKey: Long): MangaSource? {
|
||||
return sourcesMapFlow.value[sourceKey]
|
||||
}
|
||||
|
||||
fun getOrStub(sourceKey: Long): MangaSource {
|
||||
override fun getOrStub(sourceKey: Long): MangaSource {
|
||||
return sourcesMapFlow.value[sourceKey] ?: stubSourcesMap.getOrPut(sourceKey) {
|
||||
runBlocking { createStubSource(sourceKey) }
|
||||
}
|
||||
}
|
||||
|
||||
fun getOnlineSources() = sourcesMapFlow.value.values.filterIsInstance<HttpSource>()
|
||||
override fun getOnlineSources() = sourcesMapFlow.value.values.filterIsInstance<HttpSource>()
|
||||
|
||||
fun getCatalogueSources() = sourcesMapFlow.value.values.filterIsInstance<CatalogueSource>()
|
||||
override fun getCatalogueSources() = sourcesMapFlow.value.values.filterIsInstance<CatalogueSource>()
|
||||
|
||||
fun getStubSources(): List<StubMangaSource> {
|
||||
override fun getStubSources(): List<StubMangaSource> {
|
||||
val onlineSourceIds = getOnlineSources().map { it.id }
|
||||
return stubSourcesMap.values.filterNot { it.id in onlineSourceIds }
|
||||
}
|
||||
|
@ -119,52 +115,4 @@ class MangaSourceManager(
|
|||
}
|
||||
return StubMangaSource(MangaSourceData(id, "", ""))
|
||||
}
|
||||
|
||||
@Suppress("OverridingDeprecatedMember")
|
||||
inner class StubMangaSource(private val sourceData: MangaSourceData) : MangaSource {
|
||||
|
||||
override val id: Long = sourceData.id
|
||||
|
||||
override val name: String = sourceData.name.ifBlank { id.toString() }
|
||||
|
||||
override val lang: String = sourceData.lang
|
||||
|
||||
override suspend fun getMangaDetails(manga: SManga): SManga {
|
||||
throw getSourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getMangaDetails"))
|
||||
override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
|
||||
return Observable.error(getSourceNotInstalledException())
|
||||
}
|
||||
|
||||
override suspend fun getChapterList(manga: SManga): List<SChapter> {
|
||||
throw getSourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getChapterList"))
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
return Observable.error(getSourceNotInstalledException())
|
||||
}
|
||||
|
||||
override suspend fun getPageList(chapter: SChapter): List<Page> {
|
||||
throw getSourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getPageList"))
|
||||
override fun fetchPageList(chapter: SChapter): Observable<List<Page>> {
|
||||
return Observable.error(getSourceNotInstalledException())
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return if (sourceData.isMissingInfo.not()) "$name (${lang.uppercase()})" else id.toString()
|
||||
}
|
||||
|
||||
fun getSourceNotInstalledException(): SourceNotInstalledException {
|
||||
return SourceNotInstalledException(toString())
|
||||
}
|
||||
}
|
||||
|
||||
inner class SourceNotInstalledException(sourceString: String) :
|
||||
Exception(context.getString(R.string.source_not_installed, sourceString))
|
||||
}
|
|
@ -5,6 +5,7 @@ import eu.kanade.domain.source.service.SourcePreferences
|
|||
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import tachiyomi.domain.source.manga.model.MangaSourceData
|
||||
import tachiyomi.domain.source.manga.model.StubMangaSource
|
||||
import tachiyomi.source.local.entries.manga.LocalMangaSource
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
@ -32,4 +33,4 @@ fun MangaSource.getNameForMangaInfo(): String {
|
|||
|
||||
fun MangaSource.isLocal(): Boolean = id == LocalMangaSource.ID
|
||||
|
||||
fun MangaSource.isLocalOrStub(): Boolean = isLocal() || this is MangaSourceManager.StubMangaSource
|
||||
fun MangaSource.isLocalOrStub(): Boolean = isLocal() || this is StubMangaSource
|
||||
|
|
|
@ -41,9 +41,9 @@ import eu.kanade.presentation.util.Screen
|
|||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||
import eu.kanade.tachiyomi.data.preference.SharedPreferencesDataStore
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.anime.getPreferenceKey
|
||||
import eu.kanade.tachiyomi.widget.TachiyomiTextInputEditText.Companion.setIncognito
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -4,7 +4,6 @@ import androidx.compose.runtime.Immutable
|
|||
import cafe.adriel.voyager.core.model.StateScreenModel
|
||||
import cafe.adriel.voyager.core.model.coroutineScope
|
||||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.catch
|
||||
|
@ -17,6 +16,7 @@ import logcat.LogPriority
|
|||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnimeFavorites
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode
|
|||
import eu.kanade.tachiyomi.data.cache.AnimeCoverCache
|
||||
import eu.kanade.tachiyomi.data.track.EnhancedAnimeTrackService
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.ui.browse.anime.migration.AnimeMigrationFlags
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.migration.MangaMigrationFlags
|
||||
import kotlinx.coroutines.flow.update
|
||||
|
@ -50,6 +49,7 @@ import tachiyomi.domain.entries.anime.model.AnimeUpdate
|
|||
import tachiyomi.domain.items.episode.interactor.GetEpisodeByAnimeId
|
||||
import tachiyomi.domain.items.episode.interactor.UpdateEpisode
|
||||
import tachiyomi.domain.items.episode.model.toEpisodeUpdate
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.track.anime.interactor.GetAnimeTracks
|
||||
import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack
|
||||
import tachiyomi.presentation.core.screens.LoadingScreen
|
||||
|
|
|
@ -5,13 +5,13 @@ import cafe.adriel.voyager.core.model.coroutineScope
|
|||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.ui.browse.anime.source.globalsearch.AnimeSearchItemResult
|
||||
import eu.kanade.tachiyomi.ui.browse.anime.source.globalsearch.AnimeSearchScreenModel
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnime
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ import eu.kanade.tachiyomi.R
|
|||
import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.core.Constants
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.ui.browse.anime.extension.details.SourcePreferencesScreen
|
||||
import eu.kanade.tachiyomi.ui.browse.anime.source.browse.BrowseAnimeSourceScreenModel.Listing
|
||||
import eu.kanade.tachiyomi.ui.category.CategoriesTab
|
||||
|
@ -57,6 +56,7 @@ import kotlinx.coroutines.channels.Channel
|
|||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.flow.receiveAsFlow
|
||||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.domain.source.anime.model.StubAnimeSource
|
||||
import tachiyomi.presentation.core.components.material.Divider
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
|
@ -84,7 +84,7 @@ data class BrowseAnimeSourceScreen(
|
|||
}
|
||||
}
|
||||
|
||||
if (screenModel.source is AnimeSourceManager.StubAnimeSource) {
|
||||
if (screenModel.source is StubAnimeSource) {
|
||||
MissingSourceScreen(
|
||||
source = screenModel.source,
|
||||
navigateUp = navigateUp,
|
||||
|
|
|
@ -30,7 +30,6 @@ import eu.kanade.tachiyomi.data.cache.AnimeCoverCache
|
|||
import eu.kanade.tachiyomi.data.track.EnhancedAnimeTrackService
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.util.removeCovers
|
||||
import kotlinx.coroutines.flow.SharingStarted
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
|
@ -58,6 +57,7 @@ import tachiyomi.domain.entries.anime.interactor.NetworkToLocalAnime
|
|||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.entries.anime.model.toAnimeUpdate
|
||||
import tachiyomi.domain.items.episode.interactor.GetEpisodeByAnimeId
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -4,8 +4,8 @@ import androidx.compose.runtime.Immutable
|
|||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import kotlinx.coroutines.flow.update
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -41,9 +41,9 @@ import eu.kanade.presentation.util.Screen
|
|||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.SharedPreferencesDataStore
|
||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.getPreferenceKey
|
||||
import eu.kanade.tachiyomi.widget.TachiyomiTextInputEditText.Companion.setIncognito
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -4,7 +4,6 @@ import androidx.compose.runtime.Immutable
|
|||
import cafe.adriel.voyager.core.model.StateScreenModel
|
||||
import cafe.adriel.voyager.core.model.coroutineScope
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.catch
|
||||
|
@ -17,6 +16,7 @@ import logcat.LogPriority
|
|||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.entries.manga.interactor.GetMangaFavorites
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ import eu.kanade.tachiyomi.data.cache.MangaCoverCache
|
|||
import eu.kanade.tachiyomi.data.track.EnhancedMangaTrackService
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.migration.MangaMigrationFlags
|
||||
import kotlinx.coroutines.flow.update
|
||||
|
@ -49,6 +48,7 @@ import tachiyomi.domain.entries.manga.model.MangaUpdate
|
|||
import tachiyomi.domain.items.chapter.interactor.GetChapterByMangaId
|
||||
import tachiyomi.domain.items.chapter.interactor.UpdateChapter
|
||||
import tachiyomi.domain.items.chapter.model.toChapterUpdate
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.domain.track.manga.interactor.GetMangaTracks
|
||||
import tachiyomi.domain.track.manga.interactor.InsertMangaTrack
|
||||
import tachiyomi.presentation.core.screens.LoadingScreen
|
||||
|
|
|
@ -5,13 +5,13 @@ import cafe.adriel.voyager.core.model.coroutineScope
|
|||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.source.globalsearch.MangaSearchItemResult
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.source.globalsearch.MangaSearchScreenModel
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import tachiyomi.domain.entries.manga.interactor.GetManga
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ import eu.kanade.presentation.util.Screen
|
|||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.core.Constants
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.extension.details.MangaSourcePreferencesScreen
|
||||
import eu.kanade.tachiyomi.ui.browse.manga.source.browse.BrowseMangaSourceScreenModel.Listing
|
||||
|
@ -57,6 +56,7 @@ import kotlinx.coroutines.channels.Channel
|
|||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.flow.receiveAsFlow
|
||||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.domain.source.manga.model.StubMangaSource
|
||||
import tachiyomi.presentation.core.components.material.Divider
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
|
@ -84,7 +84,7 @@ data class BrowseMangaSourceScreen(
|
|||
}
|
||||
}
|
||||
|
||||
if (screenModel.source is MangaSourceManager.StubMangaSource) {
|
||||
if (screenModel.source is StubMangaSource) {
|
||||
MissingSourceScreen(
|
||||
source = screenModel.source,
|
||||
navigateUp = navigateUp,
|
||||
|
|
|
@ -29,7 +29,6 @@ import eu.kanade.tachiyomi.data.track.EnhancedMangaTrackService
|
|||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.util.removeCovers
|
||||
import kotlinx.coroutines.flow.SharingStarted
|
||||
|
@ -58,6 +57,7 @@ import tachiyomi.domain.entries.manga.interactor.NetworkToLocalManga
|
|||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.entries.manga.model.toMangaUpdate
|
||||
import tachiyomi.domain.items.chapter.interactor.GetChapterByMangaId
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.domain.track.manga.interactor.InsertMangaTrack
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -4,8 +4,8 @@ import androidx.compose.runtime.Immutable
|
|||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import kotlinx.coroutines.flow.update
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import cafe.adriel.voyager.core.model.StateScreenModel
|
|||
import cafe.adriel.voyager.core.model.coroutineScope
|
||||
import eu.kanade.core.preference.asState
|
||||
import eu.kanade.core.util.addOrRemove
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.anime.interactor.UpdateAnime
|
||||
import eu.kanade.domain.entries.anime.model.downloadedFilter
|
||||
import eu.kanade.domain.entries.anime.model.isLocal
|
||||
|
@ -34,7 +33,6 @@ import eu.kanade.tachiyomi.data.track.AnimeTrackService
|
|||
import eu.kanade.tachiyomi.data.track.EnhancedAnimeTrackService
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.network.HttpException
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.ui.entries.anime.track.AnimeTrackItem
|
||||
import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences
|
||||
import eu.kanade.tachiyomi.util.episode.getNextUnseen
|
||||
|
@ -62,6 +60,7 @@ import tachiyomi.core.util.system.logcat
|
|||
import tachiyomi.domain.category.anime.interactor.GetAnimeCategories
|
||||
import tachiyomi.domain.category.anime.interactor.SetAnimeCategories
|
||||
import tachiyomi.domain.category.model.Category
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.TriStateFilter
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnimeWithEpisodes
|
||||
import tachiyomi.domain.entries.anime.interactor.GetDuplicateLibraryAnime
|
||||
|
@ -73,6 +72,7 @@ import tachiyomi.domain.items.episode.model.Episode
|
|||
import tachiyomi.domain.items.episode.model.EpisodeUpdate
|
||||
import tachiyomi.domain.items.episode.model.NoEpisodesException
|
||||
import tachiyomi.domain.items.episode.service.getEpisodeSort
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.track.anime.interactor.GetAnimeTracks
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -51,7 +51,6 @@ import eu.kanade.tachiyomi.data.track.EnhancedAnimeTrackService
|
|||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.data.track.model.AnimeTrackSearch
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.coroutines.flow.catch
|
||||
|
@ -67,6 +66,7 @@ import tachiyomi.core.util.lang.withUIContext
|
|||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnime
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnimeWithEpisodes
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.track.anime.interactor.DeleteAnimeTrack
|
||||
import tachiyomi.domain.track.anime.interactor.GetAnimeTracks
|
||||
import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack
|
||||
|
|
|
@ -10,7 +10,6 @@ import cafe.adriel.voyager.core.model.StateScreenModel
|
|||
import cafe.adriel.voyager.core.model.coroutineScope
|
||||
import eu.kanade.core.preference.asState
|
||||
import eu.kanade.core.util.addOrRemove
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.manga.interactor.UpdateManga
|
||||
import eu.kanade.domain.entries.manga.model.downloadedFilter
|
||||
import eu.kanade.domain.entries.manga.model.isLocal
|
||||
|
@ -33,7 +32,6 @@ import eu.kanade.tachiyomi.data.track.MangaTrackService
|
|||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.network.HttpException
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.ui.entries.manga.track.MangaTrackItem
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
|
||||
import eu.kanade.tachiyomi.util.chapter.getNextUnread
|
||||
|
@ -61,6 +59,7 @@ import tachiyomi.core.util.system.logcat
|
|||
import tachiyomi.domain.category.manga.interactor.GetMangaCategories
|
||||
import tachiyomi.domain.category.manga.interactor.SetMangaCategories
|
||||
import tachiyomi.domain.category.model.Category
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.TriStateFilter
|
||||
import tachiyomi.domain.entries.applyFilter
|
||||
import tachiyomi.domain.entries.manga.interactor.GetDuplicateLibraryManga
|
||||
|
@ -72,6 +71,7 @@ import tachiyomi.domain.items.chapter.model.Chapter
|
|||
import tachiyomi.domain.items.chapter.model.ChapterUpdate
|
||||
import tachiyomi.domain.items.chapter.model.NoChaptersException
|
||||
import tachiyomi.domain.items.chapter.service.getChapterSort
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.domain.track.manga.interactor.GetMangaTracks
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -51,7 +51,6 @@ import eu.kanade.tachiyomi.data.track.EnhancedMangaTrackService
|
|||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.data.track.model.MangaTrackSearch
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.coroutines.flow.catch
|
||||
|
@ -67,6 +66,7 @@ import tachiyomi.core.util.lang.withUIContext
|
|||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.entries.manga.interactor.GetManga
|
||||
import tachiyomi.domain.entries.manga.interactor.GetMangaWithChapters
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.domain.track.manga.interactor.DeleteMangaTrack
|
||||
import tachiyomi.domain.track.manga.interactor.GetMangaTracks
|
||||
import tachiyomi.domain.track.manga.interactor.InsertMangaTrack
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package eu.kanade.tachiyomi.ui.library.anime
|
||||
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.anime.getNameForAnimeInfo
|
||||
import tachiyomi.domain.library.anime.LibraryAnime
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadCache
|
|||
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
|
||||
import eu.kanade.tachiyomi.data.track.AnimeTrackService
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.util.episode.getNextUnseen
|
||||
import eu.kanade.tachiyomi.util.removeCovers
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
@ -61,6 +60,7 @@ import tachiyomi.domain.items.episode.model.Episode
|
|||
import tachiyomi.domain.library.anime.LibraryAnime
|
||||
import tachiyomi.domain.library.anime.model.AnimeLibrarySort
|
||||
import tachiyomi.domain.library.anime.model.sort
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.track.anime.interactor.GetTracksPerAnime
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -107,8 +107,8 @@ object AnimeLibraryTab : Tab {
|
|||
|
||||
val snackbarHostState = remember { SnackbarHostState() }
|
||||
|
||||
val onClickRefresh: (Category?) -> Boolean = {
|
||||
val started = AnimeLibraryUpdateJob.startNow(context, it)
|
||||
val onClickRefresh: (Category?) -> Boolean = { category ->
|
||||
val started = AnimeLibraryUpdateJob.startNow(context, category)
|
||||
scope.launch {
|
||||
val msgRes = if (started) R.string.updating_category else R.string.update_already_running
|
||||
snackbarHostState.showSnackbar(context.getString(msgRes))
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package eu.kanade.tachiyomi.ui.library.manga
|
||||
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.getNameForMangaInfo
|
||||
import tachiyomi.domain.library.manga.LibraryManga
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ import eu.kanade.tachiyomi.data.download.manga.MangaDownloadCache
|
|||
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
|
||||
import eu.kanade.tachiyomi.data.track.MangaTrackService
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.util.chapter.getNextUnread
|
||||
|
@ -61,6 +60,7 @@ import tachiyomi.domain.items.chapter.model.Chapter
|
|||
import tachiyomi.domain.library.manga.LibraryManga
|
||||
import tachiyomi.domain.library.manga.model.MangaLibrarySort
|
||||
import tachiyomi.domain.library.manga.model.sort
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.domain.track.manga.interactor.GetTracksPerManga
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
|
|
@ -104,8 +104,8 @@ object MangaLibraryTab : Tab {
|
|||
|
||||
val snackbarHostState = remember { SnackbarHostState() }
|
||||
|
||||
val onClickRefresh: (Category?) -> Boolean = {
|
||||
val started = MangaLibraryUpdateJob.startNow(context, it)
|
||||
val onClickRefresh: (Category?) -> Boolean = { category ->
|
||||
val started = MangaLibraryUpdateJob.startNow(context, category)
|
||||
scope.launch {
|
||||
val msgRes = if (started) R.string.updating_category else R.string.update_already_running
|
||||
snackbarHostState.showSnackbar(context.getString(msgRes))
|
||||
|
|
|
@ -12,7 +12,6 @@ import androidx.core.content.FileProvider
|
|||
import androidx.core.net.toUri
|
||||
import eu.kanade.core.util.asFlow
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.items.episode.model.toDbEpisode
|
||||
import eu.kanade.domain.track.anime.model.toDbTrack
|
||||
import eu.kanade.domain.track.anime.service.DelayedAnimeTrackingUpdateJob
|
||||
|
@ -25,7 +24,6 @@ import eu.kanade.tachiyomi.core.Constants.REQUEST_EXTERNAL
|
|||
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
|
||||
import eu.kanade.tachiyomi.data.track.AnimeTrackService
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.ui.player.loader.EpisodeLoader
|
||||
import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences
|
||||
import eu.kanade.tachiyomi.util.system.isOnline
|
||||
|
@ -37,6 +35,7 @@ import logcat.LogPriority
|
|||
import tachiyomi.core.util.lang.withIOContext
|
||||
import tachiyomi.core.util.lang.withUIContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnime
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.history.anime.interactor.UpsertAnimeHistory
|
||||
|
@ -45,6 +44,7 @@ import tachiyomi.domain.items.episode.interactor.GetEpisodeByAnimeId
|
|||
import tachiyomi.domain.items.episode.interactor.UpdateEpisode
|
||||
import tachiyomi.domain.items.episode.model.Episode
|
||||
import tachiyomi.domain.items.episode.model.EpisodeUpdate
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.track.anime.interactor.GetAnimeTracks
|
||||
import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack
|
||||
import tachiyomi.source.local.entries.anime.LocalAnimeSource
|
||||
|
|
|
@ -7,7 +7,6 @@ import androidx.lifecycle.ViewModel
|
|||
import androidx.lifecycle.viewModelScope
|
||||
import eu.kanade.core.util.asFlow
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.anime.interactor.SetAnimeViewerFlags
|
||||
import eu.kanade.domain.entries.anime.model.isLocal
|
||||
import eu.kanade.domain.history.anime.interactor.GetNextEpisodes
|
||||
|
@ -30,7 +29,6 @@ import eu.kanade.tachiyomi.data.track.TrackManager
|
|||
import eu.kanade.tachiyomi.data.track.anilist.Anilist
|
||||
import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeList
|
||||
import eu.kanade.tachiyomi.network.NetworkPreferences
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.ui.player.loader.EpisodeLoader
|
||||
import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences
|
||||
import eu.kanade.tachiyomi.ui.player.viewer.SetAsCover
|
||||
|
@ -63,6 +61,7 @@ import tachiyomi.core.util.lang.launchIO
|
|||
import tachiyomi.core.util.lang.launchNonCancellable
|
||||
import tachiyomi.core.util.lang.withIOContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnime
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.domain.history.anime.interactor.UpsertAnimeHistory
|
||||
|
@ -71,6 +70,7 @@ import tachiyomi.domain.items.episode.interactor.GetEpisodeByAnimeId
|
|||
import tachiyomi.domain.items.episode.interactor.UpdateEpisode
|
||||
import tachiyomi.domain.items.episode.model.EpisodeUpdate
|
||||
import tachiyomi.domain.items.episode.service.getEpisodeSort
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.track.anime.interactor.GetAnimeTracks
|
||||
import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -7,7 +7,6 @@ import androidx.lifecycle.SavedStateHandle
|
|||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.manga.interactor.SetMangaViewerFlags
|
||||
import eu.kanade.domain.entries.manga.model.isLocal
|
||||
import eu.kanade.domain.entries.manga.model.orientationType
|
||||
|
@ -26,7 +25,6 @@ import eu.kanade.tachiyomi.data.saver.Image
|
|||
import eu.kanade.tachiyomi.data.saver.ImageSaver
|
||||
import eu.kanade.tachiyomi.data.saver.Location
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.ui.reader.loader.ChapterLoader
|
||||
|
@ -68,6 +66,7 @@ import tachiyomi.core.util.lang.launchNonCancellable
|
|||
import tachiyomi.core.util.lang.withIOContext
|
||||
import tachiyomi.core.util.lang.withUIContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.manga.interactor.GetManga
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.history.manga.interactor.UpsertMangaHistory
|
||||
|
@ -76,6 +75,7 @@ import tachiyomi.domain.items.chapter.interactor.GetChapterByMangaId
|
|||
import tachiyomi.domain.items.chapter.interactor.UpdateChapter
|
||||
import tachiyomi.domain.items.chapter.model.ChapterUpdate
|
||||
import tachiyomi.domain.items.chapter.service.getChapterSort
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.domain.track.manga.interactor.GetMangaTracks
|
||||
import tachiyomi.domain.track.manga.interactor.InsertMangaTrack
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -6,13 +6,13 @@ import eu.kanade.tachiyomi.R
|
|||
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
|
||||
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadProvider
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
|
||||
import tachiyomi.core.util.lang.withIOContext
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.domain.source.manga.model.StubMangaSource
|
||||
import tachiyomi.source.local.entries.manga.LocalMangaSource
|
||||
import tachiyomi.source.local.io.Format
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
@ -94,7 +94,7 @@ class ChapterLoader(
|
|||
is Format.Epub -> EpubPageLoader(format.file)
|
||||
}
|
||||
}
|
||||
source is MangaSourceManager.StubMangaSource -> throw source.getSourceNotInstalledException()
|
||||
source is StubMangaSource -> error(context.getString(R.string.source_not_installed, source.toString()))
|
||||
else -> error(context.getString(R.string.loader_not_implemented_error))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import cafe.adriel.voyager.core.model.coroutineScope
|
|||
import eu.kanade.core.preference.asState
|
||||
import eu.kanade.core.util.addOrRemove
|
||||
import eu.kanade.core.util.insertSeparators
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.items.episode.interactor.SetSeenStatus
|
||||
import eu.kanade.domain.library.service.LibraryPreferences
|
||||
import eu.kanade.domain.ui.UiPreferences
|
||||
|
@ -21,7 +20,6 @@ import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadCache
|
|||
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
|
||||
import eu.kanade.tachiyomi.data.download.anime.model.AnimeDownload
|
||||
import eu.kanade.tachiyomi.data.library.anime.AnimeLibraryUpdateJob
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.util.lang.toDateKey
|
||||
import eu.kanade.tachiyomi.util.lang.toRelativeString
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
|
@ -38,10 +36,12 @@ import logcat.LogPriority
|
|||
import tachiyomi.core.util.lang.launchIO
|
||||
import tachiyomi.core.util.lang.launchNonCancellable
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.interactor.GetAnime
|
||||
import tachiyomi.domain.items.episode.interactor.GetEpisode
|
||||
import tachiyomi.domain.items.episode.interactor.UpdateEpisode
|
||||
import tachiyomi.domain.items.episode.model.EpisodeUpdate
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.updates.anime.interactor.GetAnimeUpdates
|
||||
import tachiyomi.domain.updates.anime.model.AnimeUpdatesWithRelations
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -20,7 +20,6 @@ import eu.kanade.tachiyomi.data.download.manga.MangaDownloadCache
|
|||
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
|
||||
import eu.kanade.tachiyomi.data.download.manga.model.MangaDownload
|
||||
import eu.kanade.tachiyomi.data.library.manga.MangaLibraryUpdateJob
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.util.lang.toDateKey
|
||||
import eu.kanade.tachiyomi.util.lang.toRelativeString
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
|
@ -41,6 +40,7 @@ import tachiyomi.domain.entries.manga.interactor.GetManga
|
|||
import tachiyomi.domain.items.chapter.interactor.GetChapter
|
||||
import tachiyomi.domain.items.chapter.interactor.UpdateChapter
|
||||
import tachiyomi.domain.items.chapter.model.ChapterUpdate
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import tachiyomi.domain.updates.manga.interactor.GetMangaUpdates
|
||||
import tachiyomi.domain.updates.manga.model.MangaUpdatesWithRelations
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -10,8 +10,6 @@ import eu.kanade.presentation.webview.WebViewScreenContent
|
|||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity
|
||||
import eu.kanade.tachiyomi.util.system.WebViewUtil
|
||||
|
@ -22,6 +20,8 @@ import eu.kanade.tachiyomi.util.view.setComposeContent
|
|||
import logcat.LogPriority
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
class WebViewActivity : BaseActivity() {
|
||||
|
|
|
@ -6,8 +6,6 @@ import cafe.adriel.voyager.core.model.StateScreenModel
|
|||
import eu.kanade.presentation.more.stats.StatsScreenState
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.source.anime.AnimeSourceManager
|
||||
import eu.kanade.tachiyomi.source.manga.MangaSourceManager
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import eu.kanade.tachiyomi.util.system.toShareIntent
|
||||
|
@ -15,6 +13,8 @@ import eu.kanade.tachiyomi.util.system.toast
|
|||
import logcat.LogPriority
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import tachiyomi.core.util.system.logcat
|
||||
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package eu.kanade.tachiyomi.util
|
||||
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.anime.interactor.UpdateAnime
|
||||
import eu.kanade.domain.entries.anime.model.hasCustomCover
|
||||
import eu.kanade.domain.entries.anime.model.isLocal
|
||||
import eu.kanade.domain.entries.anime.model.toSAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.data.cache.AnimeCoverCache
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.anime.model.Anime
|
||||
import tachiyomi.source.local.image.anime.LocalAnimeCoverManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package eu.kanade.tachiyomi.util
|
||||
|
||||
import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.domain.entries.manga.interactor.UpdateManga
|
||||
import eu.kanade.domain.entries.manga.model.hasCustomCover
|
||||
import eu.kanade.domain.entries.manga.model.isLocal
|
||||
import eu.kanade.domain.entries.manga.model.toSManga
|
||||
import eu.kanade.tachiyomi.data.cache.MangaCoverCache
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import tachiyomi.domain.download.service.DownloadPreferences
|
||||
import tachiyomi.domain.entries.manga.model.Manga
|
||||
import tachiyomi.source.local.image.manga.LocalMangaCoverManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
|
@ -1,7 +1,18 @@
|
|||
package tachiyomi.data.source.anime
|
||||
|
||||
import tachiyomi.domain.source.anime.model.AnimeSource
|
||||
import tachiyomi.domain.source.anime.model.AnimeSourceData
|
||||
|
||||
val animeSourceMapper: (eu.kanade.tachiyomi.animesource.AnimeSource) -> AnimeSource = { source ->
|
||||
AnimeSource(
|
||||
source.id,
|
||||
source.lang,
|
||||
source.name,
|
||||
supportsLatest = false,
|
||||
isStub = false,
|
||||
)
|
||||
}
|
||||
|
||||
val animeSourceDataMapper: (Long, String, String) -> AnimeSourceData = { id, lang, name ->
|
||||
AnimeSourceData(id, lang, name)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
package tachiyomi.data.source.manga
|
||||
|
||||
import tachiyomi.domain.source.manga.model.MangaSourceData
|
||||
import tachiyomi.domain.source.manga.model.Source
|
||||
|
||||
val mangaSourceMapper: (eu.kanade.tachiyomi.source.MangaSource) -> Source = { source ->
|
||||
Source(
|
||||
source.id,
|
||||
source.lang,
|
||||
source.name,
|
||||
supportsLatest = false,
|
||||
isStub = false,
|
||||
)
|
||||
}
|
||||
|
||||
val mangaSourceDataMapper: (Long, String, String) -> MangaSourceData = { id, lang, name ->
|
||||
MangaSourceData(id, lang, name)
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package eu.kanade.domain.backup.service
|
||||
package tachiyomi.domain.backup.service
|
||||
|
||||
import eu.kanade.tachiyomi.data.preference.FLAG_CATEGORIES
|
||||
import eu.kanade.tachiyomi.data.preference.FLAG_CHAPTERS
|
||||
import eu.kanade.tachiyomi.data.preference.FLAG_HISTORY
|
||||
import eu.kanade.tachiyomi.data.preference.FLAG_TRACK
|
||||
import tachiyomi.core.preference.PreferenceStore
|
||||
import tachiyomi.core.provider.FolderProvider
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package tachiyomi.domain.backup.service
|
||||
|
||||
const val FLAG_CATEGORIES = "1"
|
||||
const val FLAG_CHAPTERS = "2"
|
||||
const val FLAG_HISTORY = "4"
|
||||
const val FLAG_TRACK = "8"
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.domain.download.service
|
||||
package tachiyomi.domain.download.service
|
||||
|
||||
import tachiyomi.core.preference.PreferenceStore
|
||||
import tachiyomi.core.provider.FolderProvider
|
|
@ -0,0 +1,33 @@
|
|||
package tachiyomi.domain.source.anime.model
|
||||
|
||||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
|
||||
@Suppress("OverridingDeprecatedMember")
|
||||
class StubAnimeSource(private val sourceData: AnimeSourceData) : AnimeSource {
|
||||
|
||||
override val id: Long = sourceData.id
|
||||
|
||||
override val name: String = sourceData.name.ifBlank { id.toString() }
|
||||
|
||||
override val lang: String = sourceData.lang
|
||||
|
||||
override suspend fun getAnimeDetails(anime: SAnime): SAnime {
|
||||
throw AnimeSourceNotInstalledException()
|
||||
}
|
||||
|
||||
override suspend fun getEpisodeList(anime: SAnime): List<SEpisode> {
|
||||
throw AnimeSourceNotInstalledException()
|
||||
}
|
||||
|
||||
override suspend fun getVideoList(episode: SEpisode): List<Video> {
|
||||
throw AnimeSourceNotInstalledException()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return if (sourceData.isMissingInfo.not()) "$name (${lang.uppercase()})" else id.toString()
|
||||
}
|
||||
}
|
||||
class AnimeSourceNotInstalledException : Exception()
|
|
@ -0,0 +1,22 @@
|
|||
package tachiyomi.domain.source.anime.service
|
||||
|
||||
import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource
|
||||
import eu.kanade.tachiyomi.animesource.AnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import tachiyomi.domain.source.anime.model.StubAnimeSource
|
||||
|
||||
interface AnimeSourceManager {
|
||||
|
||||
val catalogueSources: Flow<List<AnimeCatalogueSource>>
|
||||
|
||||
fun get(sourceKey: Long): AnimeSource?
|
||||
|
||||
fun getOrStub(sourceKey: Long): AnimeSource
|
||||
|
||||
fun getOnlineSources(): List<AnimeHttpSource>
|
||||
|
||||
fun getCatalogueSources(): List<AnimeCatalogueSource>
|
||||
|
||||
fun getStubSources(): List<StubAnimeSource>
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package tachiyomi.domain.source.manga.model
|
||||
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import rx.Observable
|
||||
|
||||
@Suppress("OverridingDeprecatedMember")
|
||||
class StubMangaSource(private val sourceData: MangaSourceData) : MangaSource {
|
||||
|
||||
override val id: Long = sourceData.id
|
||||
|
||||
override val name: String = sourceData.name.ifBlank { id.toString() }
|
||||
|
||||
override val lang: String = sourceData.lang
|
||||
|
||||
override suspend fun getMangaDetails(manga: SManga): SManga {
|
||||
throw SourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getMangaDetails"))
|
||||
override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
|
||||
return Observable.error(SourceNotInstalledException())
|
||||
}
|
||||
|
||||
override suspend fun getChapterList(manga: SManga): List<SChapter> {
|
||||
throw SourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getChapterList"))
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
return Observable.error(SourceNotInstalledException())
|
||||
}
|
||||
|
||||
override suspend fun getPageList(chapter: SChapter): List<Page> {
|
||||
throw SourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getPageList"))
|
||||
override fun fetchPageList(chapter: SChapter): Observable<List<Page>> {
|
||||
return Observable.error(SourceNotInstalledException())
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return if (sourceData.isMissingInfo.not()) "$name (${lang.uppercase()})" else id.toString()
|
||||
}
|
||||
}
|
||||
|
||||
class SourceNotInstalledException : Exception()
|
|
@ -0,0 +1,22 @@
|
|||
package tachiyomi.domain.source.manga.service
|
||||
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.MangaSource
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import tachiyomi.domain.source.manga.model.StubMangaSource
|
||||
|
||||
interface MangaSourceManager {
|
||||
|
||||
val catalogueSources: Flow<List<CatalogueSource>>
|
||||
|
||||
fun get(sourceKey: Long): MangaSource?
|
||||
|
||||
fun getOrStub(sourceKey: Long): MangaSource
|
||||
|
||||
fun getOnlineSources(): List<HttpSource>
|
||||
|
||||
fun getCatalogueSources(): List<CatalogueSource>
|
||||
|
||||
fun getStubSources(): List<StubMangaSource>
|
||||
}
|
Loading…
Reference in a new issue