mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Merge branch 'main' into fea/live-tv
This commit is contained in:
commit
a0e184ab28
4 changed files with 27 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ data class DialogItem(
|
||||||
constructor(
|
constructor(
|
||||||
@StringRes text: Int,
|
@StringRes text: Int,
|
||||||
@StringRes iconStringRes: Int,
|
@StringRes iconStringRes: Int,
|
||||||
|
iconColor: Color = Color.Unspecified,
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
) : this(
|
) : this(
|
||||||
headlineContent = {
|
headlineContent = {
|
||||||
|
|
@ -98,6 +99,7 @@ data class DialogItem(
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(id = iconStringRes),
|
text = stringResource(id = iconStringRes),
|
||||||
fontFamily = FontAwesome,
|
fontFamily = FontAwesome,
|
||||||
|
color = iconColor,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,10 @@ fun buildMoreDialogItems(
|
||||||
series: BaseItem?,
|
series: BaseItem?,
|
||||||
sourceId: UUID?,
|
sourceId: UUID?,
|
||||||
watched: Boolean,
|
watched: Boolean,
|
||||||
|
favorite: Boolean,
|
||||||
navigateTo: (Destination) -> Unit,
|
navigateTo: (Destination) -> Unit,
|
||||||
onClickWatch: (Boolean) -> Unit,
|
onClickWatch: (Boolean) -> Unit,
|
||||||
|
onClickFavorite: (Boolean) -> Unit,
|
||||||
onChooseVersion: () -> Unit,
|
onChooseVersion: () -> Unit,
|
||||||
onChooseTracks: (MediaStreamType) -> Unit,
|
onChooseTracks: (MediaStreamType) -> Unit,
|
||||||
): List<DialogItem> =
|
): List<DialogItem> =
|
||||||
|
|
@ -64,6 +66,15 @@ fun buildMoreDialogItems(
|
||||||
onClickWatch.invoke(!watched)
|
onClickWatch.invoke(!watched)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
add(
|
||||||
|
DialogItem(
|
||||||
|
text = if (favorite) R.string.remove_favorite else R.string.add_favorite,
|
||||||
|
iconStringRes = R.string.fa_heart,
|
||||||
|
iconColor = if (favorite) Color.Red else Color.Unspecified,
|
||||||
|
) {
|
||||||
|
onClickFavorite.invoke(!favorite)
|
||||||
|
},
|
||||||
|
)
|
||||||
series?.let {
|
series?.let {
|
||||||
add(
|
add(
|
||||||
DialogItem(
|
DialogItem(
|
||||||
|
|
|
||||||
|
|
@ -313,10 +313,12 @@ fun MovieDetails(
|
||||||
buildMoreDialogItems(
|
buildMoreDialogItems(
|
||||||
item = movie,
|
item = movie,
|
||||||
watched = movie.data.userData?.played ?: false,
|
watched = movie.data.userData?.played ?: false,
|
||||||
|
favorite = movie.data.userData?.isFavorite ?: false,
|
||||||
series = null,
|
series = null,
|
||||||
sourceId = chosenStreams?.sourceId,
|
sourceId = chosenStreams?.sourceId,
|
||||||
navigateTo = viewModel.navigationManager::navigateTo,
|
navigateTo = viewModel.navigationManager::navigateTo,
|
||||||
onClickWatch = viewModel::setWatched,
|
onClickWatch = viewModel::setWatched,
|
||||||
|
onClickFavorite = viewModel::setFavorite,
|
||||||
onChooseVersion = {
|
onChooseVersion = {
|
||||||
chooseVersion =
|
chooseVersion =
|
||||||
chooseVersionParams(movie.data.mediaSources!!) { idx ->
|
chooseVersionParams(movie.data.mediaSources!!) { idx ->
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ fun SeriesOverview(
|
||||||
buildMoreDialogItems(
|
buildMoreDialogItems(
|
||||||
ep,
|
ep,
|
||||||
watched = ep.data.userData?.played ?: false,
|
watched = ep.data.userData?.played ?: false,
|
||||||
|
favorite = ep.data.userData?.isFavorite ?: false,
|
||||||
series = series,
|
series = series,
|
||||||
sourceId = chosenStreams?.sourceId,
|
sourceId = chosenStreams?.sourceId,
|
||||||
navigateTo = viewModel::navigateTo,
|
navigateTo = viewModel::navigateTo,
|
||||||
|
|
@ -174,6 +175,17 @@ fun SeriesOverview(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onClickFavorite = { favorite ->
|
||||||
|
episodeList
|
||||||
|
?.getOrNull(position.episodeRowIndex)
|
||||||
|
?.let {
|
||||||
|
viewModel.setFavorite(
|
||||||
|
it.id,
|
||||||
|
favorite,
|
||||||
|
position.episodeRowIndex,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
onChooseVersion = {
|
onChooseVersion = {
|
||||||
chooseVersion =
|
chooseVersion =
|
||||||
chooseVersionParams(ep.data.mediaSources!!) { idx ->
|
chooseVersionParams(ep.data.mediaSources!!) { idx ->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue