Skip to content

Commit

Permalink
'conditional language for shared segments based on media type'
Browse files Browse the repository at this point in the history
  • Loading branch information
foglabs committed Feb 23, 2023
1 parent 7094e4b commit 4ab2328
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,13 @@ def show

if redirect_to_proxy_start_time?(@pbcore, params)
redirect_to catalog_path(params["id"], proxy_start_time: @pbcore.proxy_start_time) and return
elsif params["start"] && params["end"]
elsif params["start"] && params["end"] && @pbcore.media_type != "other"
# media type: 'other' records can exist, but they shouldnt have media, so no segmenter

media_type_verb = @pbcore.media_type == "Moving Image" ? "view" : "listen to"

# proxy start time takes precendence, this is for 'share a segment'
@clip_message = %(This is a segment of a longer program (#{ seconds_to_hms(params['start']) }-#{ seconds_to_hms(params['end']) }). <a href="/catalog/#{ @pbcore.id }">Click here to view full-length item.</a>)
@clip_message = %(This is a segment of a longer program (#{ seconds_to_hms(params['start']) }-#{ seconds_to_hms(params['end']) }). <a href="/catalog/#{ @pbcore.id }">Click here to #{ media_type_verb } full-length item.</a>)
end
end

Expand Down

0 comments on commit 4ab2328

Please sign in to comment.