From 85adde54e80d1c3d848f818aa5bb67120f0c48ee Mon Sep 17 00:00:00 2001 From: Jason Raitz Date: Mon, 7 Oct 2024 14:56:39 -0400 Subject: [PATCH] added transcript line to records - supports records with transcript info in the 856 $4$2_y - see marc_spec documentation for background on the change in fields.rb - adds rspec to the gem's gemspec dependencies!! - TODO: add a couple of tests dealing with the transcript metadata processing --- av_core.gemspec | 1 + lib/berkeley_library/av/constants.rb | 4 ++++ lib/berkeley_library/av/metadata/fields.rb | 4 +++- spec/lib/berkeley_library/av/metadata/fields_spec.rb | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/av_core.gemspec b/av_core.gemspec index 9373014..3a79f31 100644 --- a/av_core.gemspec +++ b/av_core.gemspec @@ -38,6 +38,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'irb', '~> 1.2' # workaroundfor https://github.com/bundler/bundler/issues/6929 spec.add_development_dependency 'listen', '>= 3.0.5', '< 3.2' spec.add_development_dependency 'rake', '~> 13.0' + spec.add_development_dependency 'rspec', '~> 3.0' spec.add_development_dependency 'rspec-support', '~> 3.9' spec.add_development_dependency 'rubocop', '1.26.0' spec.add_development_dependency 'rubocop-rake', '~> 0.6.0' diff --git a/lib/berkeley_library/av/constants.rb b/lib/berkeley_library/av/constants.rb index 40642da..f763198 100644 --- a/lib/berkeley_library/av/constants.rb +++ b/lib/berkeley_library/av/constants.rb @@ -5,6 +5,10 @@ module Constants TAG_LINK_FIELD = '856'.freeze TAG_TRACK_FIELD = '998'.freeze TAG_TIND_ID = '001'.freeze + TAG_TRANSCRIPT_FIELD = '856'.freeze + + SUBFIELD_CODE_URI = :u + SUBFIELD_CODE_LINKTEXT = :y # TODO: use marc/spec TAG_TIND_CATALOG_ID = '901'.freeze diff --git a/lib/berkeley_library/av/metadata/fields.rb b/lib/berkeley_library/av/metadata/fields.rb index f1420ce..eea9139 100644 --- a/lib/berkeley_library/av/metadata/fields.rb +++ b/lib/berkeley_library/av/metadata/fields.rb @@ -12,7 +12,8 @@ module Fields CREATOR_PERSONAL = Field.new(order: 2, label: 'Creator', spec: '700') CREATOR_CORPORATE = Field.new(order: 2, label: 'Creator', spec: '710') TRACKS = Field.new(order: 99, label: 'Tracks', spec: TAG_TRACK_FIELD, subfield_order: %w[g t a]) - CATALOG_LINK = Field.new(order: 999, label: 'Linked Resources', spec: "#{TAG_LINK_FIELD}{^1=\\4}{^2=\\1}") + CATALOG_LINK = Field.new(order: 998, label: 'Linked Resources', spec: "#{TAG_LINK_FIELD}{^1=\\4}{^2=\\1}") + TRANSCRIPTS = Field.new(order: 999, label: 'Transcripts', spec: "#{TAG_TRANSCRIPT_FIELD}{$y~\\Transcript}{^1=\\4}{^2=\\2}", subfield_order: %w[u y]) STANDARD_FIELDS = [ TITLE, @@ -20,6 +21,7 @@ module Fields CREATOR_PERSONAL, CREATOR_CORPORATE, TRACKS, + TRANSCRIPTS, CATALOG_LINK ].freeze diff --git a/spec/lib/berkeley_library/av/metadata/fields_spec.rb b/spec/lib/berkeley_library/av/metadata/fields_spec.rb index 5a1b36a..77f3cd9 100644 --- a/spec/lib/berkeley_library/av/metadata/fields_spec.rb +++ b/spec/lib/berkeley_library/av/metadata/fields_spec.rb @@ -75,7 +75,8 @@ class Metadata Field.new(order: 86, spec: '991$a', label: 'Access', subfields_separator: ', '), Field.new(order: 89, spec: '982$a', label: 'Collection'), Field.new(order: 99, spec: '998', label: 'Tracks', subfield_order: %w[g t a]), - Field.new(order: 999, spec: '856{^1=\4}{^2=\1}', label: 'Linked Resources') + Field.new(order: 998, spec: '856{^1=\4}{^2=\1}', label: 'Linked Resources'), + Field.new(order: 999, spec: '856{$y~\Transcript}{^1=\4}{^2=\2}', label: 'Transcripts', subfield_order: %w[u y]) ] fields = Fields.default_fields