Changeset 7569


Ignore:
Timestamp:
2004-06-09T11:27:35+12:00 (20 years ago)
Author:
kjdon
Message:

can now set gsdlconvertedfilename - gsdlsourcefilename is the original file, gsdlconvertedfilename is the converted file. calculating hash ids now uses converted filename is available, otherwise uses the source filename

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/doc.pm

    r6111 r7569  
    117117}
    118118
     119sub set_converted_filename {
     120    my $self = shift (@_);
     121    my ($converted_filename) = @_;
     122
     123    $self->set_metadata_element ($self->get_top_section(),
     124                 "gsdlconvertedfilename",
     125                 $converted_filename);
     126}
     127
     128
    119129# returns the source_filename as it was provided
    120130sub get_source_filename {
     
    122132
    123133    return $self->get_metadata_element ($self->get_top_section(), "gsdlsourcefilename");
     134}
     135
     136# returns converted filename if available else returns source filename
     137sub get_filename_for_hashing {
     138    my $self = shift (@_);
     139
     140    my $filename = $self->get_metadata_element ($self->get_top_section(), "gsdlconvertedfilename");
     141
     142    if (!defined $filename) {
     143    $filename = $self->get_metadata_element ($self->get_top_section(), "gsdlsourcefilename");
     144    }
     145    return $filename;
    124146}
    125147
     
    264286    } else {
    265287        # "hash" OID - feed file to hashfile.exe
    266         my $filename = $self->get_source_filename();
     288        #my $filename = $self->get_source_filename();
     289        # we want to use the converted file for hashing if available
     290        # cos its quicker
     291        my $filename = $self->get_filename_for_hashing();
    267292        if (defined($filename) && -e $filename) {
    268 
    269293        $OID = $self->_calc_OID ($filename);
    270 
    271294        } else {
    272295        $filename = &util::get_tmp_filename();
Note: See TracChangeset for help on using the changeset viewer.