summaryrefslogtreecommitdiffstats
path: root/apps/tagtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagtree.c')
-rw-r--r--apps/tagtree.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 33c36b7b83..66a644e59a 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -205,6 +205,7 @@ static int get_tag(int *tag)
MATCH(tag, buf, "tracknum", tag_tracknumber);
MATCH(tag, buf, "year", tag_year);
MATCH(tag, buf, "playcount", tag_playcount);
+ MATCH(tag, buf, "rating", tag_rating);
MATCH(tag, buf, "lastplayed", tag_lastplayed);
MATCH(tag, buf, "commitid", tag_commitid);
MATCH(tag, buf, "entryage", tag_virt_entryage);
@@ -603,8 +604,9 @@ static void tagtree_buffer_event(struct mp3entry *id3, bool last_track)
}
id3->playcount = tagcache_get_numeric(&tcs, tag_playcount);
+ if(!id3->rating) id3->rating = tagcache_get_numeric(&tcs, tag_rating);
id3->lastplayed = tagcache_get_numeric(&tcs, tag_lastplayed);
- id3->rating = tagcache_get_numeric(&tcs, tag_virt_autoscore) / 10;
+ id3->score = tagcache_get_numeric(&tcs, tag_virt_autoscore) / 10;
tagcache_search_finish(&tcs);
}
@@ -613,6 +615,7 @@ static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track)
{
(void)last_track;
long playcount;
+ long rating;
long playtime;
long lastplayed;
@@ -642,6 +645,8 @@ static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track)
playcount++;
+ rating = (long) id3->rating;
+
lastplayed = tagcache_increase_serial();
if (lastplayed < 0)
{
@@ -654,12 +659,13 @@ static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track)
playtime += MIN(id3->length, id3->elapsed + 15 * 1000);
logf("ube:%s", id3->path);
- logf("-> %d/%ld/%ld", last_track, playcount, playtime);
+ logf("-> %d/%ld/%d/%ld", last_track, playcount, rating, playtime);
logf("-> %ld/%ld/%ld", id3->elapsed, id3->length, MIN(id3->length, id3->elapsed + 15 * 1000));
/* lastplayed not yet supported. */
if (!tagcache_modify_numeric_entry(&tcs, tag_playcount, playcount)
+ || !tagcache_modify_numeric_entry(&tcs, tag_rating, rating)
|| !tagcache_modify_numeric_entry(&tcs, tag_playtime, playtime)
|| !tagcache_modify_numeric_entry(&tcs, tag_lastplayed, lastplayed))
{