don't toast when livestream

This commit is contained in:
Bnyro 2022-11-05 19:10:48 +01:00
parent 9795f9846f
commit 74c0fe85e2

View File

@ -863,11 +863,10 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
} }
}) })
// check if livestream
if (response.duration > 0) {
// download clicked
binding.relPlayerDownload.setOnClickListener { binding.relPlayerDownload.setOnClickListener {
if (!DownloadService.IS_DOWNLOAD_RUNNING) { if (response.duration <= 0) {
Toast.makeText(context, R.string.cannotDownload, Toast.LENGTH_SHORT).show()
} else if (!DownloadService.IS_DOWNLOAD_RUNNING) {
val newFragment = DownloadDialog(videoId!!) val newFragment = DownloadDialog(videoId!!)
newFragment.show(childFragmentManager, DownloadDialog::class.java.name) newFragment.show(childFragmentManager, DownloadDialog::class.java.name)
} else { } else {
@ -875,9 +874,6 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
.show() .show()
} }
} }
} else {
Toast.makeText(context, R.string.cannotDownload, Toast.LENGTH_SHORT).show()
}
if (response.hls != null) { if (response.hls != null) {
binding.relPlayerOpen.setOnClickListener { binding.relPlayerOpen.setOnClickListener {