Skip to content

Commit

Permalink
Check if multi-source
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulJKim committed Sep 19, 2023
1 parent 5738373 commit e59c451
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/content/message/predictions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ defmodule Content.Message.Predictions do
Predictions.Prediction.t(),
String.t(),
String.t(),
Signs.Realtime.t(),
Content.platform() | nil,
integer()
) :: t() | nil
def non_terminal(prediction, station_code, zone, platform \\ nil, width \\ 18)
def non_terminal(prediction, station_code, zone, sign, platform \\ nil, width \\ 18)

def non_terminal(prediction, station_code, zone, platform, width) do
def non_terminal(prediction, station_code, zone, sign, platform, width) do
# e.g., North Station which is non-terminal but has trips that begin there
predicted_time = prediction.seconds_until_arrival || prediction.seconds_until_departure

Expand All @@ -83,7 +84,9 @@ defmodule Content.Message.Predictions do
end

{crowding_data_confidence, crowding_description} =
if zone == "m", do: {nil, nil}, else: do_crowding(prediction)
if Signs.Utilities.SourceConfig.multi_source?(sign.source_config),
do: {nil, nil},
else: do_crowding(prediction)

case Content.Utilities.destination_for_prediction(
prediction.route_id,
Expand Down
1 change: 1 addition & 0 deletions lib/signs/utilities/predictions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ defmodule Signs.Utilities.Predictions do
prediction,
station_code,
zone,
sign,
platform(prediction, sources)
)
end
Expand Down

0 comments on commit e59c451

Please sign in to comment.