From 2901dddf0309942583ffc812168a149b65b3bdc6 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Sat, 22 Nov 2025 17:59:54 +0100 Subject: feat: Enhance bus position calculation to support previous trip shapes and improve trip ID parsing for multiple formats --- src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs') 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) -- cgit v1.3