Line | |
---|
1 | #!/usr/bin/perl -w |
---|
2 | use strict; |
---|
3 | |
---|
4 | use lib '/home/peter/projects/mp3-find/lib'; |
---|
5 | use MP3::Find qw(Filesystem); |
---|
6 | use MP3::Find::Util qw(build_query); |
---|
7 | use File::Spec::Functions qw(catfile); |
---|
8 | |
---|
9 | use Term::ReadKey; |
---|
10 | |
---|
11 | my ($DIRS, $QUERY) = build_query(@ARGV); |
---|
12 | push @$DIRS, '.' unless @$DIRS; |
---|
13 | |
---|
14 | for my $mp3 (find_mp3s( |
---|
15 | dir => $DIRS, |
---|
16 | query => $QUERY, |
---|
17 | ignore_case => 1, #$IGNORE_CASE, |
---|
18 | exact_match => 0, #$EXACT_MATCH, |
---|
19 | no_format => 1, |
---|
20 | db_file => catfile($ENV{HOME}, 'mp3.db'), |
---|
21 | )) { |
---|
22 | print "$$mp3{FILENAME}\n"; |
---|
23 | my $i; |
---|
24 | for (qw(ARTIST TITLE ALBUM YEAR GENRE)) { |
---|
25 | printf "[%d] %-6s %s\n", ++$i, $_, $$mp3{$_}; |
---|
26 | } |
---|
27 | print "Change [1-5]? "; |
---|
28 | my $key = ReadKey(0); |
---|
29 | } |
---|
30 | |
---|
Note: See
TracBrowser
for help on using the repository browser.