diff --git a/lib/content/audio/passthrough.ex b/lib/content/audio/passthrough.ex index d9a2d47a..e52058e7 100644 --- a/lib/content/audio/passthrough.ex +++ b/lib/content/audio/passthrough.ex @@ -56,8 +56,7 @@ defmodule Content.Audio.Passthrough do @spec destination_var(PaEss.destination(), String.t()) :: String.t() | nil defp destination_var(:alewife, _route_id), do: "32114" - defp destination_var(:ashmont, "Red"), do: "32117" - defp destination_var(:braintree, _route_id), do: "32118" + defp destination_var(:southbound, "Red"), do: "891" defp destination_var(:bowdoin, _route_id), do: "32111" defp destination_var(:wonderland, _route_id), do: "32110" defp destination_var(:forest_hills, _route_id), do: "32113" diff --git a/lib/signs/utilities/predictions.ex b/lib/signs/utilities/predictions.ex index 630b82b6..e48362fe 100644 --- a/lib/signs/utilities/predictions.ex +++ b/lib/signs/utilities/predictions.ex @@ -68,9 +68,9 @@ defmodule Signs.Utilities.Predictions do |> Enum.sort_by(fn prediction -> prediction.seconds_until_passthrough end) |> Enum.flat_map(fn prediction -> destination = - case Content.Utilities.destination_for_prediction(prediction) do - :southbound -> :ashmont - destination -> destination + case prediction do + %{route_id: "Red", direction_id: 0} -> :southbound + _ -> Content.Utilities.destination_for_prediction(prediction) end [ diff --git a/test/signs/realtime_test.exs b/test/signs/realtime_test.exs index cdaa7c0e..27ba1f1d 100644 --- a/test/signs/realtime_test.exs +++ b/test/signs/realtime_test.exs @@ -175,11 +175,12 @@ defmodule Signs.RealtimeTest do ] end) - expect_audios([{:canned, {"103", ["32118"], :audio_visual}}], [ - {"The next Braintree train does not take customers. Please stand back from the yellow line.", + expect_audios([{:canned, {"103", ["891"], :audio_visual}}], [ + {"The next Southbound train does not take customers. Please stand back from the yellow line.", [ - {"The next Braintree train", "does not take customers.", 3}, - {"Please stand back from", "the yellow line.", 3} + {"The next Southbound", "train does not take", 3}, + {"customers. Please stand", "back from the yellow", 3}, + {"line.", "", 3} ]} ]) @@ -196,11 +197,12 @@ defmodule Signs.RealtimeTest do [prediction(destination: :alewife, seconds_until_passthrough: 30, trip_id: "124")] end) - expect_audios([{:canned, {"103", ["32118"], :audio_visual}}], [ - {"The next Braintree train does not take customers. Please stand back from the yellow line.", + expect_audios([{:canned, {"103", ["891"], :audio_visual}}], [ + {"The next Southbound train does not take customers. Please stand back from the yellow line.", [ - {"The next Braintree train", "does not take customers.", 3}, - {"Please stand back from", "the yellow line.", 3} + {"The next Southbound", "train does not take", 3}, + {"customers. Please stand", "back from the yellow", 3}, + {"line.", "", 3} ]} ]) @@ -220,11 +222,12 @@ defmodule Signs.RealtimeTest do [prediction(destination: :southbound, seconds_until_passthrough: 30)] end) - expect_audios([{:canned, {"103", ["32117"], :audio_visual}}], [ - {"The next Ashmont train does not take customers. Please stand back from the yellow line.", + expect_audios([{:canned, {"103", ["891"], :audio_visual}}], [ + {"The next Southbound train does not take customers. Please stand back from the yellow line.", [ - {"The next Ashmont train", "does not take customers.", 3}, - {"Please stand back from", "the yellow line.", 3} + {"The next Southbound", "train does not take", 3}, + {"customers. Please stand", "back from the yellow", 3}, + {"line.", "", 3} ]} ])