summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/songdb.pl27
1 files changed, 13 insertions, 14 deletions
diff --git a/tools/songdb.pl b/tools/songdb.pl
index 11bf878057..69a3b0ae1b 100755
--- a/tools/songdb.pl
+++ b/tools/songdb.pl
@@ -153,16 +153,6 @@ sub dodir {
153 $path = $1; 153 $path = $1;
154 } 154 }
155 155
156 $entries{$path}= $id3;
157 $artists{$id3->{'ARTIST'}}++ if($id3->{'ARTIST'});
158 $genres{$id3->{'GENRE'}}++ if($id3->{'GENRE'});
159 $years{$id3->{'YEAR'}}++ if($id3->{'YEAR'});
160
161 # fallback names
162 $$id3{'ARTIST'} = "<no artist tag>" if ($$id3{'ARTIST'} eq "");
163 $$id3{'ALBUM'} = "<no album tag>" if ($$id3{'ALBUM'} eq "");
164 $$id3{'TITLE'} = "<no title tag>" if ($$id3{'TITLE'} eq "");
165
166 # Only use one case-variation of each album/artist 156 # Only use one case-variation of each album/artist
167 if (exists($lcalbums{lc($$id3{'ALBUM'})})) { 157 if (exists($lcalbums{lc($$id3{'ALBUM'})})) {
168 # if another album with different case exists 158 # if another album with different case exists
@@ -181,10 +171,19 @@ sub dodir {
181 $lcartists{lc($$id3{'ARTIST'})} = $$id3{'ARTIST'}; 171 $lcartists{lc($$id3{'ARTIST'})} = $$id3{'ARTIST'};
182 } 172 }
183 173
184 # prepend Dir name to handle duplicate album names in different 174 $entries{$path}= $id3;
185 # dirs. Meaning multi-artist cds will be handled correctly if 175 $artists{$id3->{'ARTIST'}}++ if($id3->{'ARTIST'});
186 # put in a single directory. 176 $genres{$id3->{'GENRE'}}++ if($id3->{'GENRE'});
187 my $albumid = $id3->{'ALBUM'}."___".$dir; 177 $years{$id3->{'YEAR'}}++ if($id3->{'YEAR'});
178
179 # fallback names
180 $$id3{'ARTIST'} = "<no artist tag>" if ($$id3{'ARTIST'} eq "");
181 $$id3{'ALBUM'} = "<no album tag>" if ($$id3{'ALBUM'} eq "");
182 $$id3{'TITLE'} = "<no title tag>" if ($$id3{'TITLE'} eq "");
183
184 # prepend Artist name to handle duplicate album names from other
185 # artists
186 my $albumid = $id3->{'ALBUM'}."___".$id3->{'ARTIST'};
188 187
189 if($albumid ne "<no album tag>___<no artist tag>") { 188 if($albumid ne "<no album tag>___<no artist tag>") {
190 my $num = ++$albums{$albumid}; 189 my $num = ++$albums{$albumid};