forked from recloudstream/cloudstream
		
	fixed +50 episodes selection
This commit is contained in:
		
							parent
							
								
									e349339b5a
								
							
						
					
					
						commit
						487f6ea03a
					
				
					 2 changed files with 15 additions and 16 deletions
				
			
		|  | @ -833,17 +833,15 @@ class ResultFragment : Fragment() { | |||
|                 } | ||||
| 
 | ||||
|                 ACTION_PLAY_EPISODE_IN_PLAYER -> { | ||||
|                     currentEpisodes?.let { episodes -> | ||||
|                         viewModel.getGenerator(episodes.indexOf(episodeClick.data)) | ||||
|                             ?.let { generator -> | ||||
|                                 activity?.navigate( | ||||
|                                     R.id.global_to_navigation_player, | ||||
|                                     GeneratorPlayer.newInstance( | ||||
|                                         generator | ||||
|                                     ) | ||||
|                     viewModel.getGenerator(episodeClick.data) | ||||
|                         ?.let { generator -> | ||||
|                             activity?.navigate( | ||||
|                                 R.id.global_to_navigation_player, | ||||
|                                 GeneratorPlayer.newInstance( | ||||
|                                     generator | ||||
|                                 ) | ||||
|                             } | ||||
|                     } | ||||
|                             ) | ||||
|                         } | ||||
|                 } | ||||
| 
 | ||||
|                 ACTION_RELOAD_EPISODE -> { | ||||
|  |  | |||
|  | @ -190,11 +190,10 @@ 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) | ||||
|                 } | ||||
|                 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…
	
	Add table
		Add a link
		
	
		Reference in a new issue