diff options
Diffstat (limited to 'src/Enmarcha.Backend/Services')
| -rw-r--r-- | src/Enmarcha.Backend/Services/LineFormatterService.cs | 53 | ||||
| -rw-r--r-- | src/Enmarcha.Backend/Services/OtpService.cs | 21 | ||||
| -rw-r--r-- | src/Enmarcha.Backend/Services/Processors/FeedConfigProcessor.cs | 2 |
3 files changed, 3 insertions, 73 deletions
diff --git a/src/Enmarcha.Backend/Services/LineFormatterService.cs b/src/Enmarcha.Backend/Services/LineFormatterService.cs deleted file mode 100644 index d3b6109..0000000 --- a/src/Enmarcha.Backend/Services/LineFormatterService.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Enmarcha.Backend.Types; - -namespace Enmarcha.Backend.Services; - -public class LineFormatterService -{ - public ConsolidatedCirculation Format(ConsolidatedCirculation circulation) - { - circulation.Route = circulation.Route.Replace("*", ""); - - if (circulation.Route == "FORA DE SERVIZO.G.B.") - { - circulation.Route = "García Barbón, 7 (fora de servizo)"; - return circulation; - } - - switch (circulation.Line) - { - case "A" when circulation.Route.StartsWith("\"1\""): - circulation.Line = "A1"; - circulation.Route = circulation.Route.Replace("\"1\"", ""); - return circulation; - case "6": - circulation.Route = circulation.Route - .Replace("\"", ""); - return circulation; - case "FUT": - { - if (circulation.Route == "CASTELAO-CAMELIAS-G.BARBÓN.M.GARRIDO") - { - circulation.Line = "MAR"; - circulation.Route = "MARCADOR ⚽: CASTELAO-CAMELIAS-G.BARBÓN.M.GARRIDO"; - } - - if (circulation.Route == "P. ESPAÑA-T.VIGO-S.BADÍA") - { - circulation.Line = "RIO"; - circulation.Route = "RÍO ⚽: P. ESPAÑA-T.VIGO-S.BADÍA"; - } - - if (circulation.Route == "NAVIA-BOUZAS-URZAIZ-G. ESPINO") - { - circulation.Line = "GOL"; - circulation.Route = "GOL ⚽: NAVIA-BOUZAS-URZAIZ-G. ESPINO"; - } - - return circulation; - } - default: - return circulation; - } - } -} diff --git a/src/Enmarcha.Backend/Services/OtpService.cs b/src/Enmarcha.Backend/Services/OtpService.cs index aadff77..e72877e 100644 --- a/src/Enmarcha.Backend/Services/OtpService.cs +++ b/src/Enmarcha.Backend/Services/OtpService.cs @@ -18,17 +18,15 @@ public class OtpService private readonly IMemoryCache _cache; private readonly ILogger<OtpService> _logger; private readonly FareService _fareService; - private readonly LineFormatterService _lineFormatter; private readonly FeedService _feedService; - public OtpService(HttpClient httpClient, IOptions<AppConfiguration> config, IMemoryCache cache, ILogger<OtpService> logger, FareService fareService, LineFormatterService lineFormatter, FeedService feedService) + public OtpService(HttpClient httpClient, IOptions<AppConfiguration> config, IMemoryCache cache, ILogger<OtpService> logger, FareService fareService, FeedService feedService) { _httpClient = httpClient; _config = config.Value; _cache = cache; _logger = logger; _fareService = fareService; - _lineFormatter = lineFormatter; _feedService = feedService; } @@ -334,23 +332,6 @@ public class OtpService case "6": headsign = headsign?.Replace("\"", ""); break; - case "FUT": - if (headsign == "CASTELAO-CAMELIAS-G.BARBÓN.M.GARRIDO") - { - shortName = "MAR"; - headsign = "MARCADOR ⚽: CASTELAO-CAMELIAS-G.BARBÓN.M.GARRIDO"; - } - else if (headsign == "P. ESPAÑA-T.VIGO-S.BADÍA") - { - shortName = "RIO"; - headsign = "RÍO ⚽: P. ESPAÑA-T.VIGO-S.BADÍA"; - } - else if (headsign == "NAVIA-BOUZAS-URZAIZ-G. ESPINO") - { - shortName = "GOL"; - headsign = "GOL ⚽: NAVIA-BOUZAS-URZAIZ-G. ESPINO"; - } - break; } } diff --git a/src/Enmarcha.Backend/Services/Processors/FeedConfigProcessor.cs b/src/Enmarcha.Backend/Services/Processors/FeedConfigProcessor.cs index 562b8f1..7e5a745 100644 --- a/src/Enmarcha.Backend/Services/Processors/FeedConfigProcessor.cs +++ b/src/Enmarcha.Backend/Services/Processors/FeedConfigProcessor.cs @@ -92,6 +92,8 @@ public class FeedConfigProcessor : IArrivalsProcessor arrival.Route.ShortName = "GOL"; arrival.Headsign.Destination = "GOL ⚽: NAVIA-BOUZAS-URZAIZ-G. ESPINO"; } + arrival.Route.Colour = "6CACE4"; + arrival.Route.TextColour = "000000"; break; } } |
