mirror of
https://github.com/bbara04/Purefin.git
synced 2026-03-31 17:10:08 +02:00
Add series link to episode top bar
This commit is contained in:
@@ -37,6 +37,13 @@ class EpisodeScreenViewModel @Inject constructor(
|
||||
id?.let { episodesMap[it] }
|
||||
}.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), null)
|
||||
|
||||
val seriesTitle: StateFlow<String?> = combine(
|
||||
_seriesId,
|
||||
appContentRepository.series
|
||||
) { seriesId, seriesMap ->
|
||||
seriesId?.let { id -> seriesMap[id]?.name }
|
||||
}.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), null)
|
||||
|
||||
private val _downloadState = MutableStateFlow<DownloadState>(DownloadState.NotDownloaded)
|
||||
val downloadState: StateFlow<DownloadState> = _downloadState.asStateFlow()
|
||||
|
||||
@@ -55,6 +62,11 @@ class EpisodeScreenViewModel @Inject constructor(
|
||||
navigationManager.navigate(Route.SeriesRoute(SeriesDto(id = seriesId)))
|
||||
}
|
||||
|
||||
fun onSeriesClick() {
|
||||
val seriesId = _seriesId.value ?: return
|
||||
navigationManager.navigate(Route.SeriesRoute(SeriesDto(id = seriesId)))
|
||||
}
|
||||
|
||||
fun selectEpisode(seriesId: UUID, seasonId: UUID, episodeId: UUID) {
|
||||
_episodeId.value = episodeId
|
||||
_seriesId.value = seriesId
|
||||
|
||||
Reference in New Issue
Block a user