when video size is 0mb, display unknown size instead

This commit is contained in:
elucubro 2023-11-04 15:12:09 +08:00
parent 20acd71b1a
commit 1059a3c17e

View file

@ -244,7 +244,8 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
if (video.format == VideoType.CONTAINER) { if (video.format == VideoType.CONTAINER) {
binding.urlSize.visibility = if (video.size != null) View.VISIBLE else View.GONE binding.urlSize.visibility = if (video.size != null) View.VISIBLE else View.GONE
binding.urlSize.text = binding.urlSize.text =
(if (video.extraNote != null) " : " else "") + DecimalFormat("#.##").format(video.size ?: 0).toString() + " MB" // if video size is null or 0, show "Unknown Size" else show the size in MB
(if (video.extraNote != null) " : " else "") + (if (video.size == 0) "Unknown Size" else (DecimalFormat("#.##").format(video.size ?: 0).toString()+ " MB"))
} }
else { else {
binding.urlQuality.text = "Multi Quality" binding.urlQuality.text = "Multi Quality"