diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-07 14:58:32 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-07 14:58:32 +0100 |
| commit | 52256fd634300b39b915bf1db6020d9d2871a0b4 (patch) | |
| tree | d32b219427e5974026c544132e3b0a65ffa0a82e /src/Costasdev.Busurbano.Backend | |
| parent | 4420def7411a053e930b44117e2bf63625d824dc (diff) | |
Implement experimental consolidated circulation view
Diffstat (limited to 'src/Costasdev.Busurbano.Backend')
| -rw-r--r-- | src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs b/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs index 2d35a4c..54baff8 100644 --- a/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs +++ b/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs @@ -110,9 +110,10 @@ public class VigoController : ControllerBase var now = nowLocal.AddSeconds(60 - nowLocal.Second); // Define the scope end as the time of the last realtime arrival (no extra buffer) + var lastEstimateArrivalMinutes = realTimeEstimates.Max(e => e.Minutes); var scopeEnd = realTimeEstimates.Count > 0 - ? now.AddMinutes(realTimeEstimates.Max(e => e.Minutes)) - : now; + ? now.AddMinutes(Math.Min(lastEstimateArrivalMinutes + 5, 75)) + : now.AddMinutes(60); // If no estimates, show next hour of scheduled only List<ConsolidatedCirculation> consolidatedCirculations = []; var usedTripIds = new HashSet<string>(); |
