From baaede8fe4ca037020cab92f4835b2d788fc3bf1 Mon Sep 17 00:00:00 2001 From: Htylol Date: Sat, 5 Oct 2024 13:05:17 +0500 Subject: [PATCH] Revert SKIP_GAME_TIME --- data_from_portwine/scripts/functions_helper | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index 323ab50..11abe1b 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -1325,13 +1325,19 @@ stop_portwine () { PW_TIME_IN_GAME=$(( PW_TIME_IN_GAME / 1000 )) # в секундах while IFS= read -r line ; do if [[ $line =~ ^Time= ]] ; then + SKIP_GAME_TIME="1" TIME_CURRENT=${line//Time=/} TIME_TOTAL=$(( TIME_CURRENT + PW_TIME_IN_GAME )) fi done < "$LAST_DESKTOP_FILE" IFS="$orig_IFS" - sed -i '/^Time=/d' "$LAST_DESKTOP_FILE" - echo "Time=$TIME_TOTAL" >> "$LAST_DESKTOP_FILE" + + if [[ $SKIP_GAME_TIME != 1 ]] ; then + echo "Time=$PW_TIME_IN_GAME" >> "$LAST_DESKTOP_FILE" + else + sed -i '/^Time=/d' "$LAST_DESKTOP_FILE" + echo "Time=$TIME_TOTAL" >> "$LAST_DESKTOP_FILE" + fi case "$1" in --restart)