fix: can't download new video while other download in progress

This commit is contained in:
Bnyro 2023-09-08 15:42:58 +02:00
parent 6a2c83a7bb
commit 5b5fcb4324

View File

@ -998,13 +998,10 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
binding.relPlayerDownload.setOnClickListener {
if (streams.duration <= 0) {
Toast.makeText(context, R.string.cannotDownload, Toast.LENGTH_SHORT).show()
} else if (!DownloadService.IS_DOWNLOAD_RUNNING) {
} else {
val newFragment = DownloadDialog()
newFragment.arguments = bundleOf(IntentData.videoId to videoId)
newFragment.show(childFragmentManager, DownloadDialog::class.java.name)
} else {
Toast.makeText(context, R.string.dlisinprogress, Toast.LENGTH_SHORT)
.show()
}
}