diff options
| author | Dan Everton <dan@iocaine.org> | 2007-06-25 11:33:21 +0000 |
|---|---|---|
| committer | Dan Everton <dan@iocaine.org> | 2007-06-25 11:33:21 +0000 |
| commit | 00dd14922b48ca29411d9ae3445dc5d92d050422 (patch) | |
| tree | 437db7492d48bcdc890026cd0765764ff5abcc2e /apps | |
| parent | 708ac7feb3981fe62d85b0e97c035b950a9c7d3b (diff) | |
| download | rockbox-00dd14922b48ca29411d9ae3445dc5d92d050422.zip rockbox-00dd14922b48ca29411d9ae3445dc5d92d050422.tar.gz rockbox-00dd14922b48ca29411d9ae3445dc5d92d050422.tar.bz2 rockbox-00dd14922b48ca29411d9ae3445dc5d92d050422.tar.xz | |
When building the database and a track doesn't have an album artist tag, copy the value from the artist tag. This should make browsing through album artist in the database a bit nicer. Same as FS# 7342 but different. You may need to rebuild your database to actually see any change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13710 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/tagcache.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index d82149a..41138dd 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -1595,6 +1595,7 @@ static void add_tagcache(char *path) char tracknumfix[3]; int offset = 0; int path_length = strlen(path); + bool has_albumartist; if (cachefd < 0) return ; @@ -1685,6 +1686,9 @@ static void add_tagcache(char *path) entry.tag_offset[tag_bitrate] = track.id3.bitrate; /* String tags. */ + has_albumartist = track.id3.albumartist != NULL + && strlen(track.id3.albumartist) > 0; + ADD_TAG(entry, tag_filename, &path); ADD_TAG(entry, tag_title, &track.id3.title); ADD_TAG(entry, tag_artist, &track.id3.artist); @@ -1692,7 +1696,14 @@ static void add_tagcache(char *path) ADD_TAG(entry, tag_genre, &track.id3.genre_string); ADD_TAG(entry, tag_composer, &track.id3.composer); ADD_TAG(entry, tag_comment, &track.id3.comment); - ADD_TAG(entry, tag_albumartist, &track.id3.albumartist); + if (has_albumartist) + { + ADD_TAG(entry, tag_albumartist, &track.id3.albumartist); + } + else + { + ADD_TAG(entry, tag_albumartist, &track.id3.artist); + } entry.data_length = offset; /* Write the header */ @@ -1706,7 +1717,14 @@ static void add_tagcache(char *path) write_item(track.id3.genre_string); write_item(track.id3.composer); write_item(track.id3.comment); - write_item(track.id3.albumartist); + if (has_albumartist) + { + write_item(track.id3.albumartist); + } + else + { + write_item(track.id3.artist); + } total_entry_count++; } |