summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/songdb.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/songdb.pl b/tools/songdb.pl
index 69a3b0a..987fb61 100755
--- a/tools/songdb.pl
+++ b/tools/songdb.pl
@@ -181,11 +181,11 @@ sub dodir {
$$id3{'ALBUM'} = "<no album tag>" if ($$id3{'ALBUM'} eq "");
$$id3{'TITLE'} = "<no title tag>" if ($$id3{'TITLE'} eq "");
- # prepend Artist name to handle duplicate album names from other
- # artists
- my $albumid = $id3->{'ALBUM'}."___".$id3->{'ARTIST'};
+ # Append dirname, to handle multi-artist albums
+ $$id3{'DIR'} = $dir;
+ my $albumid = $id3->{'ALBUM'}."___".$$id3{'DIR'};
- if($albumid ne "<no album tag>___<no artist tag>") {
+ if($id3->{'ALBUM'}."___".$id3->{'ARTIST'} ne "<no album tag>___<no artist tag>") {
my $num = ++$albums{$albumid};
if($num > $maxsongperalbum) {
$maxsongperalbum = $num;
@@ -443,7 +443,7 @@ if ($db) {
for (sort keys %{$artist2albums{$artist}}) {
my $id3 = $artist2albums{$artist}{$_};
- my $a = $albumcount{"$$id3{'ALBUM'}___$$id3{'ARTIST'}"} * $albumentrysize;
+ my $a = $albumcount{"$$id3{'ALBUM'}___$$id3{'DIR'}"} * $albumentrysize;
dumpint($a + $albumindex);
}