| 1 | #!/usr/bin/env perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | our $VERSION = '0.09'; # VERSION | ||
| 7 | |||
| 8 | use Video::PlaybackMachine::Schema; | ||
| 9 | use Video::PlaybackMachine::DirectoryScanner; | ||
| 10 | use Getopt::Long; | ||
| 11 | |||
| 12 | my ($directory, $db_file) = @ARGV; | ||
| 13 | |||
| 14 | MAIN: { | ||
| 15 | |||
| 16 | my $schema = Video::PlaybackMachine::Schema->connect( | ||
| 17 | "dbi:SQLite:dbname=$db_file", | ||
| 18 | '', | ||
| 19 | '' | ||
| 20 | ); | ||
| 21 | |||
| 22 | my $scanner = Video::PlaybackMachine::DirectoryScanner->new( | ||
| 23 | schema => $schema, | ||
| 24 | directories => [$directory] | ||
| 25 | ); | ||
| 26 | |||
| 27 | $scanner->scan(); | ||
| 28 | } |