NAME

MP3::Find::DB - SQLite database backend to MP3::Find

SYNOPSIS

use MP3::Find::DB;
my $finder = MP3::Find::DB->new;

my @mp3s = $finder->find_mp3s(
    dir => '/home/peter/music',
    query => {
        artist => 'ilyaimy',
        album  => 'myxomatosis',
    },
    ignore_case => 1,
);

REQUIRES

DBI, DBD::SQLite, SQL::Abstract

DESCRIPTION

This is the SQLite database backend for MP3::Find.

Note: I'm still working out some kinks in here, so this backend is currently not as stable as the Filesystem backend.

Special Options

db_file

The name of the SQLite database file to use. Defaults to ~/mp3.db.

The database should have at least one table named mp3 with the following schema:

CREATE TABLE mp3 (
    mtime         INTEGER,
    FILENAME      TEXT, 
    TITLE         TEXT, 
    ARTIST        TEXT, 
    ALBUM         TEXT,
    YEAR          INTEGER, 
    COMMENT       TEXT, 
    GENRE         TEXT, 
    TRACKNUM      INTEGER, 
    VERSION       NUMERIC,
    LAYER         INTEGER, 
    STEREO        TEXT,
    VBR           TEXT,
    BITRATE       INTEGER, 
    FREQUENCY     INTEGER, 
    SIZE          INTEGER, 
    OFFSET        INTEGER, 
    SECS          INTEGER, 
    MM            INTEGER,
    SS            INTEGER,
    MS            INTEGER, 
    TIME          TEXT,
    COPYRIGHT     TEXT, 
    PADDING       INTEGER, 
    MODE          INTEGER,
    FRAMES        INTEGER, 
    FRAME_LENGTH  INTEGER, 
    VBR_SCALE     INTEGER
);

TODO

Move the database/table creation code from mp3db into this module.

Database maintanence routines (e.g. clear out old entries)

SEE ALSO

MP3::Find, MP3::Find::DB

AUTHOR

Peter Eichman <peichman@cpan.org>

COPYRIGHT AND LICENSE

Copyright (c) 2006 by Peter Eichman. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.