forked from len0rd/rockbox
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
This commit is contained in:
parent
438366ce3a
commit
50b656ff0c
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue