summaryrefslogtreecommitdiffstats
path: root/tools/songdb.pl
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-04-24 14:30:11 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-04-24 14:30:11 +0000
commit50b656ff0cbe94d567755e15895804d55f29ed26 (patch)
tree0bebc37ce160d319f53c300bf77384d605d71004 /tools/songdb.pl
parent438366ce3adae4c944f0a5de06a1e2066325205e (diff)
downloadrockbox-50b656ff0cbe94d567755e15895804d55f29ed26.tar.gz
rockbox-50b656ff0cbe94d567755e15895804d55f29ed26.tar.bz2
rockbox-50b656ff0cbe94d567755e15895804d55f29ed26.zip
Fall back on directory name if no album tag, instead of <no album tag>.
Fall back on basename of the file if no title tag, instead of <no title tag>. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6337 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/songdb.pl')
-rwxr-xr-xtools/songdb.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/songdb.pl b/tools/songdb.pl
index 2e34360f5a..daa35577a6 100755
--- a/tools/songdb.pl
+++ b/tools/songdb.pl
@@ -178,8 +178,13 @@ sub dodir {
# fallback names
$$id3{'ARTIST'} = "<no artist tag>" if ($$id3{'ARTIST'} eq "");
- $$id3{'ALBUM'} = "<no album tag>" if ($$id3{'ALBUM'} eq "");
- $$id3{'TITLE'} = "<no title tag>" if ($$id3{'TITLE'} eq "");
+ # Fall back on the directory name (not full path dirname),
+ # if no album tag
+ $$id3{'ALBUM'} = (split m[/], $dir)[-1] if ($$id3{'ALBUM'} eq "");
+ # fall back on basename of the file if no title tag.
+ my $base;
+ ($base = $f) =~ s/\.\w+$//;
+ $$id3{'TITLE'} = $base if ($$id3{'TITLE'} eq "");
# Append dirname, to handle multi-artist albums
$$id3{'DIR'} = $dir;