-
Notifications
You must be signed in to change notification settings - Fork 3
Better handle shuttle alert directionality #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5ec7d57
153e54b
5c2c69e
d5166cc
4d1b9be
c6e841f
c755676
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,11 +36,16 @@ defmodule Concentrate.Filter.Alert.Shuttles do | |
| @spec stop_shuttling_on_route( | ||
| route_id :: String.t(), | ||
| stop_id :: String.t(), | ||
| direction_id :: 0 | 1, | ||
| :calendar.date() | integer | ||
| ) :: :start | :stop | :through | nil | ||
| def stop_shuttling_on_route(route_id, stop_id, date_or_timestamp) | ||
| def stop_shuttling_on_route(route_id, stop_id, direction_id, date_or_timestamp) | ||
| when is_binary(route_id) and is_binary(stop_id) do | ||
| case TimeTable.date_overlaps(@table, {:route_stop, route_id, stop_id}, date_or_timestamp) do | ||
| case TimeTable.date_overlaps( | ||
| @table, | ||
| {:route_stop, route_id, stop_id, direction_id}, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: I guess I'm a little surprised that you didn't need to make any corresponding changes over in the TimeTable module (or here?) for this new record structure. (I admit I'm a little rusty on ETS MatchSpecs, so I might be misunderstanding how this key ends up getting used in the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They now contain only the four-tuples - I didn't directly change the code in your "here" link, but I did change the |
||
| date_or_timestamp | ||
| ) do | ||
| [atom | _] -> atom | ||
| [] -> nil | ||
| end | ||
|
|
@@ -80,9 +85,11 @@ defmodule Concentrate.Filter.Alert.Shuttles do | |
|
|
||
| route_stops = | ||
| if is_binary(stop_id) and is_binary(route_id) do | ||
| [ | ||
| {{:route_stop, route_id, stop_id}, shuttle_type(InformedEntity.activities(entity))} | ||
| ] | ||
| shuttle_type = shuttle_type(InformedEntity.activities(entity)) | ||
|
|
||
| for direction_id <- direction_ids(InformedEntity.direction_id(entity)) do | ||
| {{:route_stop, route_id, stop_id, direction_id}, shuttle_type} | ||
| end | ||
| else | ||
| [] | ||
| end | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion:
Should the cache key also be updated to avoid using a cached install from the old version of asdf / the asdf install action? Like change
-v2-to-v4-in the key, perhaps.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4d1b9be