Skip to content

Commit

Permalink
Merge branch 'master' into cm/triptych-simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaddox5 committed Sep 5, 2023
2 parents ef6daa0 + 27e2c39 commit 0eeee60
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 18 deletions.
6 changes: 6 additions & 0 deletions assets/css/v2/triptych/evergreen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@
padding: 12px 24px 18px 24px;
}
}

.evergreen-content-image__image,
.evergreen-content-video.looping-video {
width: 1080px;
height: 1920px;
}
1 change: 1 addition & 0 deletions assets/css/v2/triptych/screen_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.left-pane,
.middle-pane,
.right-pane {
overflow: hidden;
position: absolute;
width: 1080px;
height: 1920px;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 46 additions & 18 deletions lib/screens/v2/candidate_generator/widgets/local_evergreen_set.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,57 @@ defmodule Screens.V2.CandidateGenerator.Widgets.LocalEvergreenSet do
config,
now
) do
partial_path = Path.join("triptych_psas/", folder_name)
path = Path.join("assets/static/images/", partial_path)
relative_path = Path.join("triptych_psas/", folder_name)
path = Path.join("assets/static/images/", relative_path)

case File.ls(path) do
{:ok, files} ->
Enum.map(files, fn file ->
slot_name = string_to_slot_name(file)

%EvergreenContent{
screen: config,
slot_names: [slot_name],
asset_url: Path.join([partial_path, "/", file]),
priority: [2],
schedule: schedule,
now: now,
text_for_audio: "",
audio_priority: [0]
}
end)
build_widget_instances(files, config, relative_path, schedule, now)

{:error, _} ->
Logger.warn("[Triptych PSA filepath not found] folder_name=#{folder_name}")
[]
relative_path = "triptych_psas/"
path = Path.join("assets/static/images/", relative_path)

case File.ls(path) do
{:ok, triptych_psa_contents} ->
default_psa_folder = hd(triptych_psa_contents)
default_psa_path = Path.join(path, default_psa_folder)

Logger.warn(
"[Triptych PSA filepath not found, using default] configured_folder_name=#{folder_name} default_folder_name=#{default_psa_folder}"
)

files = File.ls!(default_psa_path)

build_widget_instances(
files,
config,
Path.join(relative_path, default_psa_folder),
schedule,
now
)

{:error, _} ->
Logger.warn("[Empty triptych PSA folder]")
[]
end
end
end

defp build_widget_instances(files, config, partial_path, schedule, now) do
Enum.map(files, fn file ->
slot_name = string_to_slot_name(file)

%EvergreenContent{
screen: config,
slot_names: [slot_name],
asset_url: Path.join([partial_path, "/", file]),
priority: [2],
schedule: schedule,
now: now,
text_for_audio: "",
audio_priority: [0]
}
end)
end
end

0 comments on commit 0eeee60

Please sign in to comment.