Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-raitz committed Sep 26, 2024
1 parent 50c173e commit 262dd77
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions app/views/player/_record.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,6 @@
<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 @@ -101,13 +85,30 @@
</td>
</tr>
<% end %>
<% 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 %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if transcripts.any? %>
<tr>
<th><p>Transcripts</p></th>
<td>
<% transcripts.each do |transcript| %>
<%= link_to(File.basename(URI.parse(transcript).path), transcript) %>
<%= link_to(transcript['y'], transcript['u']) %>
<% end %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
Expand Down

0 comments on commit 262dd77

Please sign in to comment.