diff --git a/app/views/player/_record.html.erb b/app/views/player/_record.html.erb index a07ebb3..bc4cb20 100644 --- a/app/views/player/_record.html.erb +++ b/app/views/player/_record.html.erb @@ -5,7 +5,22 @@

<%= record.title %>

- + <% #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? %>

No track information found.

<% else %> @@ -86,6 +101,14 @@ <% end %> + <% if transcripts.any? %> + +

Transcripts

+ + <% transcripts.each do |transcript| %> + <%= link_to(File.basename(URI.parse(transcript).path), transcript) %> + <% end %> + <% end %> <% end %> diff --git a/docker-compose.yml b/docker-compose.yml index 8f5060a..9ce9812 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.8" - services: app: build: . @@ -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 \ No newline at end of file