use warnings;
use strict;
-use MARC::Fast;
+use MARC::Fast 0.12;
use base qw/WebPAC::Common/;
use Carp qw/confess/;
my $db = new MARC::Fast(
marcdb => $arg->{path},
- hash_filter => sub {
- my ( $l, $nr ) = @_;
- Encode::decode( 'utf-8', $l );
- },
);
my $db_size = $db->count - 1; # FIXME
sub fetch_rec {
my $self = shift;
- my $mfn = shift;
+ my ($mfn, $filter_coderef) = @_;
if ($mfn > $self->{_marc_size}) {
$self->_get_logger()->warn("seek beyond database size $self->{_marc_size} to $mfn");
} else {
my $marc = $self->{_marc_db} || confess "no _marc_db?";
- my $row = $marc->to_hash($mfn, include_subfields => 1);
+ my $row = $marc->to_hash($mfn, include_subfields => 1, hash_filter => $filter_coderef);
push @{$row->{'000'}}, $mfn;
push @{$row->{'leader'}}, $marc->last_leader;
return $row;