chat: фикс 0:00 у длинных голосовых — b64_decode терял последний байт без padding + formatTime в мс

This commit is contained in:
evgeny committed 2026-09-07 22:36:23 +03:00
1 parent 1345f44e10
commit ba557e2b9d
2 files changed
+3 -5

No files matched your search

@@ -449,8 +449,6 @@ private fun formatDuration(ms: Int): String {
private fun formatTime(ts: Long): String {
if (ts == 0L) return ""
val s = ts / 1_000_000_000
val h = (s / 3600) % 24
val m = (s / 60) % 60
return "%02d:%02d".format(h, m)
val dt = java.time.Instant.ofEpochMilli(ts).atZone(java.time.ZoneId.systemDefault())
return "%02d:%02d".format(dt.hour, dt.minute)
}