From 5ad745a6ed24013994c814940b0adf534e026a2e Mon Sep 17 00:00:00 2001 From: Ryan Aidan Date: Sat, 22 Jun 2024 02:28:11 +0800 Subject: [PATCH] feat: don't show minutes and seconds if ETA is >0d (#27, #7) --- rm-main/src/utils.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rm-main/src/utils.rs b/rm-main/src/utils.rs index 785d0d4..6ef3177 100644 --- a/rm-main/src/utils.rs +++ b/rm-main/src/utils.rs @@ -46,6 +46,10 @@ pub fn seconds_to_human_format(seconds: i64) -> String { let hours = rest / HOUR; rest %= HOUR; curr_string = format!("{curr_string}{hours}h"); + // skip minutes & seconds for multi-day durations + if seconds > DAY { + return curr_string; + } } if seconds > MINUTE {