diff options
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 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 | ||