summaryrefslogtreecommitdiffstats
path: root/tools/songdb.pl
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2005-04-13 12:52:34 +0000
committerJonas Häggqvist <rasher@rasher.dk>2005-04-13 12:52:34 +0000
commitc5056b1d7f6e1d9811b01ef14b3afe2724db0a3b (patch)
tree7e2cbd2f25e892e5696bec7c099f73d2c782be0b /tools/songdb.pl
parenta32a74e5910e979714b5e3384be369cc722ae03d (diff)
downloadrockbox-c5056b1d7f6e1d9811b01ef14b3afe2724db0a3b.tar.gz
rockbox-c5056b1d7f6e1d9811b01ef14b3afe2724db0a3b.tar.bz2
rockbox-c5056b1d7f6e1d9811b01ef14b3afe2724db0a3b.zip
Almost supports multiple-artist albums - needs a special case for songs with no album tag
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6279 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/songdb.pl')
-rwxr-xr-xtools/songdb.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/songdb.pl b/tools/songdb.pl
index 69a3b0ae1b..987fb61972 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);
}