Changeset 8166


Ignore:
Timestamp:
2004-09-28T13:42:16+12:00 (20 years ago)
Author:
mdewsnip
Message:

Added FileSize metadata in most plugins.

Location:
trunk/gsdl/perllib/plugins
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/BasPlug.pm

    r7818 r8166  
    437437    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Encoding", $encoding);
    438438    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
     439    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "FileSize", (-s $filename));
     440
    439441    my ($filemeta) = $file =~ /([^\\\/]+)$/;
    440442    # how do we know what encoding the filename is in?
  • trunk/gsdl/perllib/plugins/ConvertToPlug.pm

    r8121 r8166  
    313313    }
    314314    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
     315    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "FileSize", (-s $filename));
     316
    315317    # include any metadata passed in from previous plugins
    316318    # note that this metadata is associated with the top level section
  • trunk/gsdl/perllib/plugins/ConvertToRogPlug.pm

    r7571 r8166  
    383383    }
    384384    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
    385 
     385    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "FileSize", (-s $filename));
    386386
    387387    my $track_no = "1";
  • trunk/gsdl/perllib/plugins/FOXPlug.pm

    r8121 r8166  
    247247
    248248    $doc_obj->add_metadata($section, "FileFormat", "FOX");
     249    $doc_obj->add_metadata($section, "FileSize",   (-s $file));
    249250
    250251    # start of document
  • trunk/gsdl/perllib/plugins/HBPlug.pm

    r8121 r8166  
    265265    $doc_obj->associate_file($bookcover, "cover.jpg", "image/jpeg");
    266266    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
     267    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "FileFormat", "HB");
     268    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "FileSize", (-s $htmlfile));
    267269
    268270    my $cursection = $doc_obj->get_top_section();
    269271   
    270     $doc_obj->add_metadata($cursection, "FileFormat", "HB");
    271 
    272272    # add metadata for top level of document
    273273    foreach my $field (keys(%$metadata)) {
  • trunk/gsdl/perllib/plugins/ImagePlug.pm

    r8145 r8166  
    201201   
    202202    $doc_obj->add_metadata ($section, "FileFormat", $type);
     203    $doc_obj->add_metadata ($section, "FileSize",   $image_size);
    203204
    204205    $doc_obj->add_metadata ($section, "ImageType",   $image_type);
  • trunk/gsdl/perllib/plugins/MACROPlug.pm

    r8121 r8166  
    151151    # FileFormat metadata
    152152    $doc_obj->add_metadata($thissection, "FileFormat", "MACRO");
     153    $doc_obj->add_metadata($thissection, "FileSize", (-s $file));
    153154
    154155    return 1;
  • trunk/gsdl/perllib/plugins/MP3Plug.pm

    r7528 r8166  
    334334    $doc_obj->set_OIDtype ("incremental");    # this is done to avoid hashing content of file
    335335    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
     336    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "FileSize", (-s $filename));
    336337
    337338    # associate the file with the document
  • trunk/gsdl/perllib/plugins/OAIPlug.pm

    r8121 r8166  
    142142    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
    143143    $doc_obj->add_metadata($doc_obj->get_top_section(), "FileFormat", "OAI");
     144    $doc_obj->add_metadata($dob_obj->get_top_section(), "FileSize", (-s $filename));
    144145
    145146
  • trunk/gsdl/perllib/plugins/RogPlug.pm

    r8121 r8166  
    191191    $doc_obj->add_metadata($cursection, "TitleSafe",     $title_safe);
    192192    $doc_obj->add_metadata($cursection, "TVal",          $song->{'tval'});
    193     $doc_obj->add_metadata($cursection, "FileFormat",   "Rog");
     193    $doc_obj->add_metadata($cursection, "FileFormat",    "Rog");
     194    $doc_obj->add_metadata($cursection, "FileSize",      (-s $file));
    194195
    195196    foreach $md ( @{$song->{'metadata'}} )
  • trunk/gsdl/perllib/plugins/UnknownPlug.pm

    r7508 r8166  
    190190    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
    191191    $doc_obj->add_metadata($doc_obj->get_top_section(), "Source", &ghtml::dmsafe($file)); # set the filename as Source metadata to be consistent with other plugins
     192    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "FileSize", (-s $filename));
    192193
    193194    # associate the file with the document
Note: See TracChangeset for help on using the changeset viewer.