summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/tagcache.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 3745d07049..6567a781f8 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -678,11 +678,16 @@ void tagcache_search_finish(struct tagcache_search *tcs)
678} 678}
679 679
680#ifdef HAVE_TC_RAMCACHE 680#ifdef HAVE_TC_RAMCACHE
681static struct tagfile_entry *get_tag(struct index_entry *entry, int tag) 681static struct tagfile_entry *get_tag(const struct index_entry *entry, int tag)
682{ 682{
683 return (struct tagfile_entry *)&hdr->tags[tag][entry->tag_seek[tag]]; 683 return (struct tagfile_entry *)&hdr->tags[tag][entry->tag_seek[tag]];
684} 684}
685 685
686static long get_tag_numeric(const struct index_entry *entry, int tag)
687{
688 return entry->tag_seek[tag];
689}
690
686bool tagcache_fill_tags(struct mp3entry *id3, const char *filename) 691bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
687{ 692{
688 struct index_entry *entry; 693 struct index_entry *entry;
@@ -697,6 +702,11 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
697 id3->album = get_tag(entry, tag_album)->tag_data; 702 id3->album = get_tag(entry, tag_album)->tag_data;
698 id3->genre_string = get_tag(entry, tag_genre)->tag_data; 703 id3->genre_string = get_tag(entry, tag_genre)->tag_data;
699 id3->composer = get_tag(entry, tag_composer)->tag_data; 704 id3->composer = get_tag(entry, tag_composer)->tag_data;
705 id3->year = get_tag_numeric(entry, tag_year);
706 id3->tracknum = get_tag_numeric(entry, tag_tracknumber);
707 id3->bitrate = get_tag_numeric(entry, tag_bitrate);
708 if (id3->bitrate == 0)
709 id3->bitrate = 1;
700 710
701 return true; 711 return true;
702} 712}