fix: only display the delay when when >0

This commit is contained in:
etwas 2025-05-19 12:17:00 +02:00
parent 98373b4063
commit 971e9c84c9
Signed by: etwas
SSH key fingerprint: SHA256:bHhIeAdn/2k9jmOs6+u6ox98VYmoHUN3HfnpV2w8Ws0

View file

@ -41,10 +41,18 @@ fi
# Create the tooltip text
tooltip="${train_type} ${line_number} (${train_number} - Br${train_series})\n\n"
tooltip+="Next stop: ${next_stop_name}\n"
if [[ $next_stop_arrival_delay == "" ]]; then
tooltip+="${next_stop_arrival_time} - ${distance_km} km"
else
tooltip+="${next_stop_arrival_time} (${next_stop_arrival_delay}) - ${distance_km} km"
fi
# Create the JSON object
if [[ $next_stop_arrival_delay == "" ]]; then
text="${speed} km/h - ${next_stop_arrival_time}"
else
text="${speed} km/h - ${next_stop_arrival_time} (${next_stop_arrival_delay})"
fi
alt="Current speed"
class="icestats"
percentage=0