From 1059a3c17e18dda9a0162f2dfffbe7acb19237db Mon Sep 17 00:00:00 2001 From: elucubro <114061880+elucubro@users.noreply.github.com> Date: Sat, 4 Nov 2023 15:12:09 +0800 Subject: [PATCH] when video size is 0mb, display unknown size instead --- .../java/ani/dantotsu/media/anime/SelectorDialogFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ani/dantotsu/media/anime/SelectorDialogFragment.kt b/app/src/main/java/ani/dantotsu/media/anime/SelectorDialogFragment.kt index a9761811..3690a276 100644 --- a/app/src/main/java/ani/dantotsu/media/anime/SelectorDialogFragment.kt +++ b/app/src/main/java/ani/dantotsu/media/anime/SelectorDialogFragment.kt @@ -244,7 +244,8 @@ class SelectorDialogFragment : BottomSheetDialogFragment() { if (video.format == VideoType.CONTAINER) { binding.urlSize.visibility = if (video.size != null) View.VISIBLE else View.GONE 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 { binding.urlQuality.text = "Multi Quality"