aboutsummaryrefslogtreecommitdiff
path: root/src/Enmarcha.Backend/Services/FeedService.cs
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2026-03-16 13:01:36 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2026-03-16 13:01:36 +0100
commit3ce586243a49f34b36d0fe4099bbfb2631610f11 (patch)
treee1a654141bd8aef1852883aeef25392409c73891 /src/Enmarcha.Backend/Services/FeedService.cs
parent99005bce74288a415ac748414e0f8b522e207c93 (diff)
New marquee generation logic for Xunta
Diffstat (limited to 'src/Enmarcha.Backend/Services/FeedService.cs')
-rw-r--r--src/Enmarcha.Backend/Services/FeedService.cs27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/Enmarcha.Backend/Services/FeedService.cs b/src/Enmarcha.Backend/Services/FeedService.cs
index c3e33fd..4ea3752 100644
--- a/src/Enmarcha.Backend/Services/FeedService.cs
+++ b/src/Enmarcha.Backend/Services/FeedService.cs
@@ -148,7 +148,7 @@ public class FeedService
return result;
}
- public string NormalizeStopName(string feedId, string name)
+ public static string NormalizeStopName(string feedId, string name)
{
if (feedId == "vitrasa")
{
@@ -171,7 +171,7 @@ public class FeedService
return Regex.Replace(normalized, @"[^a-z0-9]", "");
}
- public string GetStreetName(string originalName)
+ public static string GetStreetName(string originalName)
{
var name = RemoveQuotationMarks.Replace(originalName, "").Trim();
var match = StreetNameRegex.Match(name);
@@ -189,29 +189,6 @@ public class FeedService
return streetName.Trim();
}
- public string? GenerateMarquee(string feedId, List<string> nextStops)
- {
- if (nextStops.Count == 0) return null;
-
- if (feedId is "vitrasa" or "tranvias" or "tussa" or "ourense")
- {
- var streets = nextStops
- .Select(GetStreetName)
- .Where(s => !string.IsNullOrWhiteSpace(s))
- .Distinct()
- .ToList();
-
- return string.Join(" - ", streets);
- }
-
- return feedId switch
- {
- "xunta" => string.Join(" > ", nextStops),
- "renfe" => string.Join(" - ", nextStops),
- _ => string.Join(", ", nextStops.Take(4))
- };
- }
-
public bool IsStopHidden(string stopId)
{
return HiddenStops.Contains(stopId);