Metadata::DB::Indexer

Facilitates indexing records for use with Metadata::DB and sub packages
Download

Metadata::DB::Indexer Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Leo Charre
  • Publisher web site:
  • http://search.cpan.org/~leocharre/

Metadata::DB::Indexer Tags


Metadata::DB::Indexer Description

Facilitates indexing records for use with Metadata::DB and sub packages Metadata::DB::Indexer is a Perl module that facilitates indexing records for use with Metadata::DB and sub packages. This is meant to completely recreate a metadata table for records. Useful for indexing files, or any sort of record that may be timely.SYNOPSIS use Metadata::DB::Indexer; use File::Find::Rule; no strict 'refs'; *{Metadata::DB::Indexer::record_identifier_to_metadata} = \&get_mp3_meta; my $finder = File::Find::Rule->file()->name( qr/\.mp3$/i ); my @music_files = $finder->in('/home/myself'); my $absdb = '/home/myself/music.db'; my $dbh = DBI->connect("dbi:SQLite:dbname=$absdb","",""); my $indexer = Metadata::DB::Indexer({ DBH => $dbh }); $indexer->records_to_index(\@music_files); $indexer->run; sub get_mp3_meta { my $record_identifier = shift; my $abs_path = $record_identifier; my $meta = my_sub_that_turns_mp3s_to_hashref_meta($abs_path); $meta or return; # this registers a fail, and continues return $meta; } my $total = $indexed->records_to_index_count; my $indexed = $indexer->records_indexed_count; print STDERR "Done, indexed $indexed of $total records.\n"; Requirements: · Perl


Metadata::DB::Indexer Related Software