summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
authorDan Everton <dan@iocaine.org>2007-06-25 11:33:21 +0000
committerDan Everton <dan@iocaine.org>2007-06-25 11:33:21 +0000
commit00dd14922b48ca29411d9ae3445dc5d92d050422 (patch)
tree437db7492d48bcdc890026cd0765764ff5abcc2e /apps/tagcache.c
parent708ac7feb3981fe62d85b0e97c035b950a9c7d3b (diff)
downloadrockbox-00dd14922b48ca29411d9ae3445dc5d92d050422.tar.gz
rockbox-00dd14922b48ca29411d9ae3445dc5d92d050422.zip
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/tagcache.c')
-rw-r--r--apps/tagcache.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index d82149ad3b..41138ddf2c 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -1595,6 +1595,7 @@ static void add_tagcache(char *path)
1595 char tracknumfix[3]; 1595 char tracknumfix[3];
1596 int offset = 0; 1596 int offset = 0;
1597 int path_length = strlen(path); 1597 int path_length = strlen(path);
1598 bool has_albumartist;
1598 1599
1599 if (cachefd < 0) 1600 if (cachefd < 0)
1600 return ; 1601 return ;
@@ -1685,6 +1686,9 @@ static void add_tagcache(char *path)
1685 entry.tag_offset[tag_bitrate] = track.id3.bitrate; 1686 entry.tag_offset[tag_bitrate] = track.id3.bitrate;
1686 1687
1687 /* String tags. */ 1688 /* String tags. */
1689 has_albumartist = track.id3.albumartist != NULL
1690 && strlen(track.id3.albumartist) > 0;
1691
1688 ADD_TAG(entry, tag_filename, &path); 1692 ADD_TAG(entry, tag_filename, &path);
1689 ADD_TAG(entry, tag_title, &track.id3.title); 1693 ADD_TAG(entry, tag_title, &track.id3.title);
1690 ADD_TAG(entry, tag_artist, &track.id3.artist); 1694 ADD_TAG(entry, tag_artist, &track.id3.artist);
@@ -1692,7 +1696,14 @@ static void add_tagcache(char *path)
1692 ADD_TAG(entry, tag_genre, &track.id3.genre_string); 1696 ADD_TAG(entry, tag_genre, &track.id3.genre_string);
1693 ADD_TAG(entry, tag_composer, &track.id3.composer); 1697 ADD_TAG(entry, tag_composer, &track.id3.composer);
1694 ADD_TAG(entry, tag_comment, &track.id3.comment); 1698 ADD_TAG(entry, tag_comment, &track.id3.comment);
1695 ADD_TAG(entry, tag_albumartist, &track.id3.albumartist); 1699 if (has_albumartist)
1700 {
1701 ADD_TAG(entry, tag_albumartist, &track.id3.albumartist);
1702 }
1703 else
1704 {
1705 ADD_TAG(entry, tag_albumartist, &track.id3.artist);
1706 }
1696 entry.data_length = offset; 1707 entry.data_length = offset;
1697 1708
1698 /* Write the header */ 1709 /* Write the header */
@@ -1706,7 +1717,14 @@ static void add_tagcache(char *path)
1706 write_item(track.id3.genre_string); 1717 write_item(track.id3.genre_string);
1707 write_item(track.id3.composer); 1718 write_item(track.id3.composer);
1708 write_item(track.id3.comment); 1719 write_item(track.id3.comment);
1709 write_item(track.id3.albumartist); 1720 if (has_albumartist)
1721 {
1722 write_item(track.id3.albumartist);
1723 }
1724 else
1725 {
1726 write_item(track.id3.artist);
1727 }
1710 total_entry_count++; 1728 total_entry_count++;
1711} 1729}
1712 1730