aboutsummaryrefslogtreecommitdiff
path: root/src/Costasdev.Busurbano.Backend/Controllers
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-11-22 17:59:54 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-11-22 18:33:23 +0100
commit2901dddf0309942583ffc812168a149b65b3bdc6 (patch)
tree1a03b4bb3838f823735dfd3c9d0340785987949e /src/Costasdev.Busurbano.Backend/Controllers
parentdc1cf01110fe9ecee05c11dcddc50cb3c8f674fc (diff)
feat: Enhance bus position calculation to support previous trip shapes and improve trip ID parsing for multiple formats
Diffstat (limited to 'src/Costasdev.Busurbano.Backend/Controllers')
-rw-r--r--src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs b/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs
index 570b56d..8e3f54e 100644
--- a/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs
+++ b/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs
@@ -315,8 +315,8 @@ public class VigoController : ControllerBase
// If the bus is further away than the distance from the start of the trip to the stop,
// it implies the bus is on the previous trip (or earlier).
double distOnPrevTrip = estimate.Meters - closestCirculation.ShapeDistTraveled;
- usePreviousShape = !isRunning &&
- !string.IsNullOrEmpty(closestCirculation.PreviousTripShapeId) &&
+ usePreviousShape = !isRunning &&
+ !string.IsNullOrEmpty(closestCirculation.PreviousTripShapeId) &&
distOnPrevTrip > 0;
if (usePreviousShape)