lib/psulib_traject/processors/media_type.rb
# Check 949a types, a record may have multiple 949s with different 949a's
Check 949a types, a record may have multiple 949s with different 949a's
Check 949a types a record may have multiple 949s with different 949a ' s
def resolve_949a
      [].tap do |results|
        Traject::MarcExtractor.cached('949a').collect_matching_lines(record) do |field, spec, extractor|
          field_949a = extractor.collect_subfields(field, spec).first
          results << 'Blu-ray' if /BLU-RAY/i.match?(field_949a)
          results << 'Videocassette (VHS)' if field_949a&.match?(Regexp.union(/ZVC/i, /ARTVC/i, /MVC/i))
          results << 'DVD' if field_949a&.match?(Regexp.union(/ZDVD/i, /ARTDVD/i, /MDVD/i, /ADVD/i, /DVD/i))
          results << 'Laser disc' if field_949a&.match?(Regexp.union(/ZVD/i, /MVD/i))
        end
      end
    end
def resolve_949a [ ] . tap do | results | Traject :: MarcExtractor . cached ( '949a' ) . collect_matching_lines ( record ) do | field , spec , extractor | field_949a = extractor . collect_subfields ( field , spec ) . first results << 'Blu-ray' if / BLU-RAY /i . match? ( field_949a ) results << 'Videocassette (VHS)' if field_949a &. match? ( Regexp . union ( / ZVC /i , / ARTVC /i , / MVC /i ) ) results << 'DVD' if field_949a &. match? ( Regexp . union ( / ZDVD /i , / ARTDVD /i , / MDVD /i , / ADVD /i , / DVD /i ) ) results << 'Laser disc' if field_949a &. match? ( Regexp . union ( / ZVD /i , / MVD /i ) ) end end end
Check 949a types, a record may have multiple 949s with different 949a's
Check 949a types a record may have multiple 949s with different 949a ' s