Skip to content

Commit

Permalink
added transcript line to records
Browse files Browse the repository at this point in the history
 - 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
  • Loading branch information
jason-raitz committed Oct 7, 2024
1 parent 465f07d commit 85adde5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions av_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions lib/berkeley_library/av/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lib/berkeley_library/av/metadata/fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ 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,
DESCRIPTION,
CREATOR_PERSONAL,
CREATOR_CORPORATE,
TRACKS,
TRANSCRIPTS,
CATALOG_LINK
].freeze

Expand Down
3 changes: 2 additions & 1 deletion spec/lib/berkeley_library/av/metadata/fields_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85adde5

Please sign in to comment.