From 7bde9447cc25831bb3ac3a56fef2552ed8429b9e Mon Sep 17 00:00:00 2001 From: Cora Grant Date: Mon, 4 Nov 2024 10:25:36 -0500 Subject: [PATCH 1/2] refactor: namespace GL E-ink headways module This frees up the base `Headways` module name for use by a new system based on the OIO-controlled headway values in Signs UI. The plan is for this to eventually be used by all screen types, including GL E-ink, as part of the new "destinations" logic. --- lib/screens/v2/candidate_generator/gl_eink.ex | 2 +- lib/screens/{ => v2/candidate_generator/gl_eink}/headways.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename lib/screens/{ => v2/candidate_generator/gl_eink}/headways.ex (99%) diff --git a/lib/screens/v2/candidate_generator/gl_eink.ex b/lib/screens/v2/candidate_generator/gl_eink.ex index 4bdeffc0f..67a7d222a 100644 --- a/lib/screens/v2/candidate_generator/gl_eink.ex +++ b/lib/screens/v2/candidate_generator/gl_eink.ex @@ -224,7 +224,7 @@ defmodule Screens.V2.CandidateGenerator.GlEink do defp format_headway(route_id, stop_id, direction_id, departures_to_concat \\ []) do destination = fetch_destination(route_id, direction_id) - case Screens.Headways.by_route_id(route_id, stop_id, direction_id, nil) do + case __MODULE__.Headways.by_route_id(route_id, stop_id, direction_id, nil) do nil -> :overnight diff --git a/lib/screens/headways.ex b/lib/screens/v2/candidate_generator/gl_eink/headways.ex similarity index 99% rename from lib/screens/headways.ex rename to lib/screens/v2/candidate_generator/gl_eink/headways.ex index 846d9471e..a1e9a5a9e 100644 --- a/lib/screens/headways.ex +++ b/lib/screens/v2/candidate_generator/gl_eink/headways.ex @@ -1,4 +1,4 @@ -defmodule Screens.Headways do +defmodule Screens.V2.CandidateGenerator.GlEink.Headways do @moduledoc false alias Screens.Schedules.Schedule From fe7b33061d8b52949421e5b4ac0e1aa419f2cf17 Mon Sep 17 00:00:00 2001 From: Cora Grant Date: Mon, 4 Nov 2024 16:20:20 -0500 Subject: [PATCH 2/2] refactor: remove unused Stop function --- lib/screens/stops/stop.ex | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/screens/stops/stop.ex b/lib/screens/stops/stop.ex index c935a130a..642d7da80 100644 --- a/lib/screens/stops/stop.ex +++ b/lib/screens/stops/stop.ex @@ -282,17 +282,6 @@ defmodule Screens.Stops.Stop do end) end - def fetch_parent_stop_id(stop_id) do - case Screens.V3Api.get_json("stops/" <> stop_id, %{"include" => "parent_station"}) do - {:ok, %{"included" => [included_data]}} -> - %{"id" => parent_station_id} = included_data - parent_station_id - - _ -> - nil - end - end - def fetch_subway_platforms_for_stop(stop_id) do case Screens.V3Api.get_json("stops/" <> stop_id, %{"include" => "child_stops"}) do {:ok, %{"included" => child_stop_data}} ->