Skip to content

Commit

Permalink
Appease Credo
Browse files Browse the repository at this point in the history
  • Loading branch information
jzimbel-mbta committed Sep 18, 2023
1 parent 954fa5c commit 77528d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
15 changes: 9 additions & 6 deletions lib/screens/log_screen_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ defmodule Screens.LogScreenData do
screen_id,
last_refresh,
is_screen,
requestor,
screen_side \\ nil,
rotation_index \\ nil,
triptych_pane \\ nil,
triptych_player_name \\ nil,
ofm_app_package_version \\ nil
params
) do
requestor = params["requestor"]

if is_screen or not is_nil(requestor) do
screen_side = params["screen_side"]
rotation_index = params["rotation_index"]
triptych_pane = params["pane"]
triptych_player_name = params["player_name"]
ofm_app_package_version = params["version"]

data =
%{
screen_id: screen_id,
Expand Down
6 changes: 2 additions & 4 deletions lib/screens_web/controllers/screen_api_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule ScreensWeb.ScreenApiController do
screen_id,
last_refresh,
is_screen,
params["requestor"]
params
)

if nonexistent_screen?(screen_id) do
Expand All @@ -60,9 +60,7 @@ defmodule ScreensWeb.ScreenApiController do
screen_id,
nil,
is_screen,
params["requestor"],
nil,
rotation_index
params
)

if nonexistent_screen?(screen_id) do
Expand Down
13 changes: 2 additions & 11 deletions lib/screens_web/controllers/v2/screen_api_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@ defmodule ScreensWeb.V2.ScreenApiController do
def show(conn, %{"id" => screen_id, "last_refresh" => last_refresh} = params) do
is_screen = ScreensWeb.UserAgent.is_screen_conn?(conn, screen_id)
screen_side = params["screen_side"]
rotation_index = params["rotation_index"]
triptych_pane = params["pane"]
triptych_player_name = params["player_name"]
ofm_app_package_version = params["version"]

LogScreenData.log_data_request(
screen_id,
last_refresh,
is_screen,
params["requestor"],
screen_side,
rotation_index,
triptych_pane,
triptych_player_name,
ofm_app_package_version
params
)

cond do
Expand Down Expand Up @@ -117,8 +109,7 @@ defmodule ScreensWeb.V2.ScreenApiController do
screen_id,
last_refresh,
false,
params["requestor"],
params["screen_side"]
params
)

cond do
Expand Down

0 comments on commit 77528d2

Please sign in to comment.