Skip to content

Commit

Permalink
update: use 'detailPagePath' as key
Browse files Browse the repository at this point in the history
  • Loading branch information
muedsa committed Aug 22, 2024
1 parent b4ef6a3 commit 7941692
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ import com.muedsa.compose.tv.useLocalNavHostController
import com.muedsa.compose.tv.widget.CardType
import com.muedsa.compose.tv.widget.ImageContentCard
import com.muedsa.compose.tv.widget.ScreenBackgroundType
import com.muedsa.jcytv.theme.GirdLastItemHeight
import com.muedsa.jcytv.theme.VideoPosterSize
import com.muedsa.jcytv.screens.home.useLocalHomeScreenBackgroundState
import com.muedsa.jcytv.screens.NavigationItems
import com.muedsa.jcytv.screens.home.useLocalHomeScreenBackgroundState
import com.muedsa.jcytv.screens.navigate
import com.muedsa.jcytv.theme.GirdLastItemHeight
import com.muedsa.jcytv.theme.VideoPosterSize
import com.muedsa.model.LazyType
import com.muedsa.uitl.LogUtil

Expand Down Expand Up @@ -216,7 +216,7 @@ fun CatalogScreen(
) {
itemsIndexed(
items = searchAnimeLP.list,
key = { _, item -> item.id }
key = { _, item -> item.detailPagePath }
) { index, item ->
val itemFocusRequester = remember {
FocusRequester()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CatalogViewModel @Inject constructor(
val iterator = mList.iterator()
while (iterator.hasNext()) {
val videoInfo = iterator.next()
val fastFirst = lp.list.fastFirstOrNull { it.id == videoInfo.id }
val fastFirst = lp.list.fastFirstOrNull { it.detailPagePath == videoInfo.detailPagePath }
if (fastFirst != null) {
LogUtil.d("fetchCatalog error, Duplicate video. \n$fastFirst \n$videoInfo")
iterator.remove()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fun SearchResult(
) {
itemsIndexed(
items = animeList,
key = { _, item -> item.id }
key = { _, item -> item.detailPagePath }
) { _, item ->
ImageContentCard(
modifier = Modifier.padding(end = ImageCardRowCardPadding),
Expand Down

0 comments on commit 7941692

Please sign in to comment.