mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixed +50 episodes selection
This commit is contained in:
parent
e349339b5a
commit
487f6ea03a
2 changed files with 15 additions and 16 deletions
|
@ -833,8 +833,7 @@ class ResultFragment : Fragment() {
|
|||
}
|
||||
|
||||
ACTION_PLAY_EPISODE_IN_PLAYER -> {
|
||||
currentEpisodes?.let { episodes ->
|
||||
viewModel.getGenerator(episodes.indexOf(episodeClick.data))
|
||||
viewModel.getGenerator(episodeClick.data)
|
||||
?.let { generator ->
|
||||
activity?.navigate(
|
||||
R.id.global_to_navigation_player,
|
||||
|
@ -844,7 +843,6 @@ class ResultFragment : Fragment() {
|
|||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ACTION_RELOAD_EPISODE -> {
|
||||
viewModel.loadEpisode(episodeClick.data, false)
|
||||
|
|
|
@ -190,12 +190,11 @@ class ResultViewModel : ViewModel() {
|
|||
}
|
||||
|
||||
fun changeDubStatus(status: DubStatus?) {
|
||||
if(status == null) return
|
||||
dubSubEpisodes.value?.get(status)?.let { episodes ->
|
||||
id.value?.let {
|
||||
if (status != null) {
|
||||
setDub(it, status)
|
||||
}
|
||||
}
|
||||
_dubStatus.postValue(status)
|
||||
updateEpisodes(null, episodes, null)
|
||||
}
|
||||
|
@ -207,7 +206,7 @@ class ResultViewModel : ViewModel() {
|
|||
clearCache: Boolean = false
|
||||
): Resource<Pair<Set<ExtractorLink>, Set<SubtitleData>>> {
|
||||
return safeApiCall {
|
||||
val index = _episodes.value?.indexOf(episode) ?: throw Exception("invalid Index")
|
||||
val index = _episodes.value?.indexOf(episode) ?: episode.index
|
||||
|
||||
val currentLinks = mutableSetOf<ExtractorLink>()
|
||||
val currentSubs = mutableSetOf<SubtitleData>()
|
||||
|
@ -225,8 +224,10 @@ class ResultViewModel : ViewModel() {
|
|||
}
|
||||
}
|
||||
|
||||
fun getGenerator(episodeIndex: Int): IGenerator? {
|
||||
generator?.goto(episodeIndex)
|
||||
fun getGenerator(episode: ResultEpisode): IGenerator? {
|
||||
val index = _episodes.value?.indexOf(episode) ?: episode.index
|
||||
|
||||
generator?.goto(index)
|
||||
return generator
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue