Don't attempt to initialize manga details from BrowseSource or Search screens

This was effectively DDoSing sources as it does a request for every entry to get the details (primarily a cover image).
The expectation now is that users have to open individual entries to load the details/cover if needed.
This isn't necessary for most sources, which are able to provide covers as part of the listing normally.
This commit is contained in:
arkon
2023-03-26 13:12:32 -04:00
parent 1de4bc9586
commit 1a61130f0b
6 changed files with 10 additions and 72 deletions

View File

@@ -29,7 +29,7 @@ fun GlobalSearchScreen(
navigateUp: () -> Unit,
onChangeSearchQuery: (String?) -> Unit,
onSearch: (String) -> Unit,
getManga: @Composable (CatalogueSource, Manga) -> State<Manga>,
getManga: @Composable (Manga) -> State<Manga>,
onClickSource: (CatalogueSource) -> Unit,
onClickItem: (Manga) -> Unit,
onLongClickItem: (Manga) -> Unit,
@@ -62,7 +62,7 @@ fun GlobalSearchScreen(
private fun GlobalSearchContent(
items: Map<CatalogueSource, SearchItemResult>,
contentPadding: PaddingValues,
getManga: @Composable (CatalogueSource, Manga) -> State<Manga>,
getManga: @Composable (Manga) -> State<Manga>,
onClickSource: (CatalogueSource) -> Unit,
onClickItem: (Manga) -> Unit,
onLongClickItem: (Manga) -> Unit,
@@ -96,7 +96,7 @@ private fun GlobalSearchContent(
GlobalSearchCardRow(
titles = result.result,
getManga = { getManga(source, it) },
getManga = { getManga(it) },
onClick = onClickItem,
onLongClick = onLongClickItem,
)

View File

@@ -21,7 +21,7 @@ import tachiyomi.presentation.core.components.material.Scaffold
fun MigrateSearchScreen(
navigateUp: () -> Unit,
state: MigrateSearchState,
getManga: @Composable (CatalogueSource, Manga) -> State<Manga>,
getManga: @Composable (Manga) -> State<Manga>,
onChangeSearchQuery: (String?) -> Unit,
onSearch: (String) -> Unit,
onClickSource: (CatalogueSource) -> Unit,
@@ -58,7 +58,7 @@ private fun MigrateSearchContent(
sourceId: Long,
items: Map<CatalogueSource, SearchItemResult>,
contentPadding: PaddingValues,
getManga: @Composable (CatalogueSource, Manga) -> State<Manga>,
getManga: @Composable (Manga) -> State<Manga>,
onClickSource: (CatalogueSource) -> Unit,
onClickItem: (Manga) -> Unit,
onLongClickItem: (Manga) -> Unit,
@@ -85,7 +85,7 @@ private fun MigrateSearchContent(
GlobalSearchCardRow(
titles = result.result,
getManga = { getManga(source, it) },
getManga = { getManga(it) },
onClick = onClickItem,
onLongClick = onLongClickItem,
)