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,8 +833,7 @@ class ResultFragment : Fragment() { | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 ACTION_PLAY_EPISODE_IN_PLAYER -> { |                 ACTION_PLAY_EPISODE_IN_PLAYER -> { | ||||||
|                     currentEpisodes?.let { episodes -> |                     viewModel.getGenerator(episodeClick.data) | ||||||
|                         viewModel.getGenerator(episodes.indexOf(episodeClick.data)) |  | ||||||
|                         ?.let { generator -> |                         ?.let { generator -> | ||||||
|                             activity?.navigate( |                             activity?.navigate( | ||||||
|                                 R.id.global_to_navigation_player, |                                 R.id.global_to_navigation_player, | ||||||
|  | @ -844,7 +843,6 @@ class ResultFragment : Fragment() { | ||||||
|                             ) |                             ) | ||||||
|                         } |                         } | ||||||
|                 } |                 } | ||||||
|                 } |  | ||||||
| 
 | 
 | ||||||
|                 ACTION_RELOAD_EPISODE -> { |                 ACTION_RELOAD_EPISODE -> { | ||||||
|                     viewModel.loadEpisode(episodeClick.data, false) |                     viewModel.loadEpisode(episodeClick.data, false) | ||||||
|  |  | ||||||
|  | @ -190,12 +190,11 @@ class ResultViewModel : ViewModel() { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     fun changeDubStatus(status: DubStatus?) { |     fun changeDubStatus(status: DubStatus?) { | ||||||
|  |         if(status == null) return | ||||||
|         dubSubEpisodes.value?.get(status)?.let { episodes -> |         dubSubEpisodes.value?.get(status)?.let { episodes -> | ||||||
|             id.value?.let { |             id.value?.let { | ||||||
|                 if (status != null) { |  | ||||||
|                 setDub(it, status) |                 setDub(it, status) | ||||||
|             } |             } | ||||||
|             } |  | ||||||
|             _dubStatus.postValue(status) |             _dubStatus.postValue(status) | ||||||
|             updateEpisodes(null, episodes, null) |             updateEpisodes(null, episodes, null) | ||||||
|         } |         } | ||||||
|  | @ -207,7 +206,7 @@ class ResultViewModel : ViewModel() { | ||||||
|         clearCache: Boolean = false |         clearCache: Boolean = false | ||||||
|     ): Resource<Pair<Set<ExtractorLink>, Set<SubtitleData>>> { |     ): Resource<Pair<Set<ExtractorLink>, Set<SubtitleData>>> { | ||||||
|         return safeApiCall { |         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 currentLinks = mutableSetOf<ExtractorLink>() | ||||||
|             val currentSubs = mutableSetOf<SubtitleData>() |             val currentSubs = mutableSetOf<SubtitleData>() | ||||||
|  | @ -225,8 +224,10 @@ class ResultViewModel : ViewModel() { | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     fun getGenerator(episodeIndex: Int): IGenerator? { |     fun getGenerator(episode: ResultEpisode): IGenerator? { | ||||||
|         generator?.goto(episodeIndex) |         val index = _episodes.value?.indexOf(episode) ?: episode.index | ||||||
|  | 
 | ||||||
|  |         generator?.goto(index) | ||||||
|         return generator |         return generator | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue