Process ebrary records for microform weirdness
authorDan Scott <dscott@laurentian.ca>
Wed, 30 Mar 2016 20:43:32 +0000 (16:43 -0400)
committerDan Scott <dscott@laurentian.ca>
Wed, 30 Mar 2016 20:43:32 +0000 (16:43 -0400)
For unknown reasons, many of the ProQuest records included a malformed
008 that ended up identifying the item as a microform item, and throwing
off the language coding.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/sql/Pg/update_marc_records_in_database.sql

index f7f8cab..3e116cf 100644 (file)
@@ -75,6 +75,20 @@ foreach my $ocho (@eights) {
     } elsif ($uri =~ m#sagepub#) {
         $ocho->update('y' => 'Available online / disponible en ligne (Sage)');
         $ocho->delete_subfield(code => 'z', match => qr/Available/);
+    } elsif ($uri =~ m#ebrary#) {
+        $ocho->update('y' => 'Available online / disponible en ligne (ebrary)');
+        $ocho->delete_subfield(code => 'z', match => qr/Available/);
+
+        # Fix microform weirdness in ebrary records
+        my $ff = $record->field('008');
+        if ($ff) {
+            my $ffd = $ff->data();
+            my $fff = substr($ffd, 23, 1);
+            if ($fff == 'b') {
+                my $newff = substr($ffd, 0, 22) . ' s ' . substr($ffd, 24);
+                $ff->update($newff);
+            }
+        }
     }
 }