Meilleur suivi du temps MPD

This commit is contained in:
Breizh 2022-03-15 00:18:30 +01:00
parent 111c95f1c9
commit b5539911ad

View file

@ -32,9 +32,11 @@ human_time() {
fi
local minutes=$(( $seconds / 60 ))
seconds=$(( $seconds % 60 ))
if [[ "$minutes" -ge 90 ]]
if [[ "$minutes" -ge 60 ]]
then
printf "%5s\n" "${minutes}m"
local hours=$(( $minutes / 60 ))
minutes=$(( $minutes % 60 ))
printf "%02dh%02d\n" "$hours" "$minutes"
else
printf "%02d:%02d\n" "$minutes" "$seconds"
fi