fix: dismiss after extractors loaded
This commit is contained in:
parent
34a9a55d4f
commit
96e29a8c59
1 changed files with 12 additions and 6 deletions
|
@ -181,16 +181,6 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
|
|||
model.loadEpisodeVideos(ep, media!!.selected!!.sourceIndex)
|
||||
withContext(Dispatchers.Main) {
|
||||
binding.selectorProgressBar.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
} else {
|
||||
media!!.anime?.episodes?.set(media!!.anime?.selectedEpisode!!, ep)
|
||||
adapter.addAll(ep.extractors)
|
||||
if (model.watchSources!!.isDownloadedSource(media?.selected!!.sourceIndex)) {
|
||||
adapter.performClick(0)
|
||||
}
|
||||
binding.selectorProgressBar.visibility = View.GONE
|
||||
}
|
||||
if (adapter.itemCount == 0) {
|
||||
snackString(getString(R.string.stream_selection_empty))
|
||||
tryWith {
|
||||
|
@ -199,6 +189,22 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
media!!.anime?.episodes?.set(media!!.anime?.selectedEpisode!!, ep)
|
||||
adapter.addAll(ep.extractors)
|
||||
if (ep.extractors?.size == 0) {
|
||||
snackString(getString(R.string.stream_selection_empty))
|
||||
tryWith {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
if (model.watchSources!!.isDownloadedSource(media?.selected!!.sourceIndex)) {
|
||||
adapter.performClick(0)
|
||||
}
|
||||
binding.selectorProgressBar.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue