Skip to content

Commit

Permalink
don't fiter out passthroughs
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulJKim committed Nov 13, 2024
1 parent 18ee9ff commit a4db738
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/predictions/predictions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ defmodule Predictions.Predictions do
|> Stream.flat_map(&transform_stop_time_updates/1)
|> Stream.filter(fn {update, _, _, _, _, _, _} ->
(update["arrival"] && update["arrival"]["uncertainty"]) ||
(update["departure"] && update["departure"]["uncertainty"])
(update["departure"] && update["departure"]["uncertainty"]) ||
update["passthrough_time"]
end)
|> Stream.map(&prediction_from_update(&1, current_time))
|> Enum.reject(
&((is_nil(&1.seconds_until_arrival) and is_nil(&1.seconds_until_departure)) or
&((is_nil(&1.seconds_until_arrival) and is_nil(&1.seconds_until_departure) and
is_nil(&1.passthrough_time)) or
has_departed?(&1))
)

Expand Down

0 comments on commit a4db738

Please sign in to comment.