summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/songdb.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/songdb.pl b/tools/songdb.pl
index a9fc78ee4a..8657e88b52 100755
--- a/tools/songdb.pl
+++ b/tools/songdb.pl
@@ -10,6 +10,7 @@
10my $db = "rockbox.id3db"; 10my $db = "rockbox.id3db";
11my $dir; 11my $dir;
12my $strip; 12my $strip;
13my $add;
13my $verbose; 14my $verbose;
14my $help; 15my $help;
15my $dirisalbum; 16my $dirisalbum;
@@ -31,6 +32,11 @@ while($ARGV[0]) {
31 shift @ARGV; 32 shift @ARGV;
32 shift @ARGV; 33 shift @ARGV;
33 } 34 }
35 elsif($ARGV[0] eq "--add") {
36 $add = $ARGV[1];
37 shift @ARGV;
38 shift @ARGV;
39 }
34 elsif($ARGV[0] eq "--verbose") { 40 elsif($ARGV[0] eq "--verbose") {
35 $verbose = 1; 41 $verbose = 1;
36 shift @ARGV; 42 shift @ARGV;
@@ -66,7 +72,7 @@ my $dbver = 2;
66 72
67if(! -d $dir or $help) { 73if(! -d $dir or $help) {
68 print "'$dir' is not a directory\n" if ($dir ne "" and ! -d $dir); 74 print "'$dir' is not a directory\n" if ($dir ne "" and ! -d $dir);
69 print "songdb --path <dir> [--dirisalbum] [--dirisalbumname] [--db <file>] [--strip <path>] [--verbose] [--help]\n"; 75 print "songdb --path <dir> [--dirisalbum] [--dirisalbumname] [--db <file>] [--strip <path>] [--add <path>] [--verbose] [--help]\n";
70 exit; 76 exit;
71} 77}
72 78
@@ -166,6 +172,10 @@ sub dodir {
166 $path = $1; 172 $path = $1;
167 } 173 }
168 174
175 if ($add ne "") {
176 $path = $add . $path;
177 }
178
169 # Only use one case-variation of each album/artist 179 # Only use one case-variation of each album/artist
170 if (exists($lcalbums{lc($$id3{'ALBUM'})})) { 180 if (exists($lcalbums{lc($$id3{'ALBUM'})})) {
171 # if another album with different case exists 181 # if another album with different case exists