Fix movie page library & collection tabs not updating (#594)

## Description
Ensures the tabs on movie page use separate view models so the data
isn't shared between them.

### Related issues
Fixes #591
This commit is contained in:
Ray 2025-12-29 15:35:42 -05:00 committed by GitHub
parent aa194f5a2d
commit 622a99631b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -518,6 +518,7 @@ fun CollectionFolderGrid(
playEnabled: Boolean,
defaultViewOptions: ViewOptions,
modifier: Modifier = Modifier,
viewModelKey: String? = itemId.toServerString(),
initialSortAndDirection: SortAndDirection? = null,
showTitle: Boolean = true,
positionCallback: ((columns: Int, position: Int) -> Unit)? = null,
@ -531,6 +532,7 @@ fun CollectionFolderGrid(
onClickItem,
sortOptions,
playEnabled,
viewModelKey = viewModelKey,
defaultViewOptions = defaultViewOptions,
modifier = modifier,
initialSortAndDirection = initialSortAndDirection,
@ -551,6 +553,7 @@ fun CollectionFolderGrid(
playEnabled: Boolean,
defaultViewOptions: ViewOptions,
modifier: Modifier = Modifier,
viewModelKey: String? = itemId,
initialSortAndDirection: SortAndDirection? = null,
showTitle: Boolean = true,
positionCallback: ((columns: Int, position: Int) -> Unit)? = null,
@ -559,7 +562,7 @@ fun CollectionFolderGrid(
playlistViewModel: AddPlaylistViewModel = hiltViewModel(),
viewModel: CollectionFolderViewModel =
hiltViewModel<CollectionFolderViewModel, CollectionFolderViewModel.Factory>(
key = itemId,
key = viewModelKey,
) {
it.create(
itemId = itemId,

View file

@ -115,6 +115,7 @@ fun CollectionFolderMovie(
preferencesViewModel.navigationManager.navigateTo(item.destination())
},
itemId = destination.itemId,
viewModelKey = "${destination.itemId}_library",
initialFilter =
CollectionFolderFilter(
filter =
@ -146,6 +147,7 @@ fun CollectionFolderMovie(
preferencesViewModel.navigationManager.navigateTo(item.destination())
},
itemId = destination.itemId,
viewModelKey = "${destination.itemId}_collection",
initialFilter =
CollectionFolderFilter(
filter =