Skip to content

Commit

Permalink
grabbing transcript links if available
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-raitz committed Sep 20, 2024
1 parent aacaf2d commit 50c173e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
25 changes: 24 additions & 1 deletion app/views/player/_record.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,22 @@
<section class="record">

<h1><%= record.title %></h1>

<% #record.metadata.marc_record.class %>
<% transcripts = [] %>
<% eight56_fields = record.metadata.marc_record.fields(['856']) %>
<% if eight56_fields.any? %>
<% #eight56_fields.each {|f| f.to_hash } %>
<% eight56_fields.each do |f| %>
<% if f.indicator1 == '4' && f.indicator2 == '2' %>
<% subfields = f.subfields.each_with_object({}) {|sf, hash| hash[sf.code] = sf.value } %>
<% if subfields['u'] && subfields['y'] && subfields['y'].downcase.include?('transcript') %>
<% transcripts << subfields['u'] %>
<% end %>
<% end %>
<% end %>
<% end %>
<% #byebug %>
<% if record.tracks.empty? %>
<p>No track information found.</p>
<% else %>
Expand Down Expand Up @@ -86,6 +101,14 @@
</td>
</tr>
<% end %>
<% if transcripts.any? %>
<tr>
<th><p>Transcripts</p></th>
<td>
<% transcripts.each do |transcript| %>
<%= link_to(File.basename(URI.parse(transcript).path), transcript) %>
<% end %>
<% end %>
<% end %>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
app:
build: .
Expand All @@ -15,3 +13,5 @@ services:
# Note that this mounts the *entire* repo directory (including
# files ignored in .dockerignore when building the image)
- ./:/opt/app
tty: true
stdin_open: true

0 comments on commit 50c173e

Please sign in to comment.