From 7af70dccf6913e5f8d58c2327430964a75b76808 Mon Sep 17 00:00:00 2001 From: q3aql Date: Fri, 28 Jan 2022 18:42:06 +0100 Subject: [PATCH] Fixed failure to display cut-off time (ks-mix) --- src/ks-mix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/ks-mix b/src/ks-mix index 213177f..7aadc33 100755 --- a/src/ks-mix +++ b/src/ks-mix @@ -698,6 +698,17 @@ elif [ "${1}" == "-evti" ] ; then hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter}) minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter}) secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter}) + # Adjust time to display correctly + if [ ${secondPlusRaw} -ge 60 ] ; then + newSecondPlusRaw=$(expr ${secondPlusRaw} - 60) + secondPlusRaw=${newSecondPlusRaw} + minutePlusRaw=$(expr ${minutePlusRaw} + 1) + fi + if [ ${minutePlusRaw} -ge 60 ] ; then + newMinutePlusRaw=$(expr ${minutePlusRaw} - 60) + minutePlusRaw=${newMinutePlusRaw} + hourPlusRaw=$(expr ${hourPlusRaw} + 1) + fi # Convert time total hourPlus=$(zero_number "${hourPlusRaw}") minutePlus=$(zero_number "${minutePlusRaw}") @@ -932,6 +943,17 @@ elif [ "${1}" == "-eati" ] ; then hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter}) minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter}) secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter}) + # Adjust time to display correctly + if [ ${secondPlusRaw} -ge 60 ] ; then + newSecondPlusRaw=$(expr ${secondPlusRaw} - 60) + secondPlusRaw=${newSecondPlusRaw} + minutePlusRaw=$(expr ${minutePlusRaw} + 1) + fi + if [ ${minutePlusRaw} -ge 60 ] ; then + newMinutePlusRaw=$(expr ${minutePlusRaw} - 60) + minutePlusRaw=${newMinutePlusRaw} + hourPlusRaw=$(expr ${hourPlusRaw} + 1) + fi # Convert time total hourPlus=$(zero_number "${hourPlusRaw}") minutePlus=$(zero_number "${minutePlusRaw}") @@ -1186,6 +1208,17 @@ elif [ "${1}" == "-evat" ] ; then hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter}) minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter}) secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter}) + # Adjust time to display correctly + if [ ${secondPlusRaw} -ge 60 ] ; then + newSecondPlusRaw=$(expr ${secondPlusRaw} - 60) + secondPlusRaw=${newSecondPlusRaw} + minutePlusRaw=$(expr ${minutePlusRaw} + 1) + fi + if [ ${minutePlusRaw} -ge 60 ] ; then + newMinutePlusRaw=$(expr ${minutePlusRaw} - 60) + minutePlusRaw=${newMinutePlusRaw} + hourPlusRaw=$(expr ${hourPlusRaw} + 1) + fi # Convert time total hourPlus=$(zero_number "${hourPlusRaw}") minutePlus=$(zero_number "${minutePlusRaw}")