diff options
| -rw-r--r-- | apps/tagtree.c | 16 | ||||
| -rw-r--r-- | firmware/export/id3.h | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c index 8b7182c..6602e9a 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -378,7 +378,23 @@ static void tagtree_buffer_event(struct mp3entry *id3, bool last_track) (void)id3; (void)last_track; + /* Do not gather data unless proper setting has been enabled. */ + if (!global_settings.runtimedb) + return; + logf("be:%d%s", last_track, id3->path); + + if (!tagcache_find_index(&tcs, id3->path)) + { + logf("tc stat: not found: %s", id3->path); + return; + } + + id3->playcount = tagcache_get_numeric(&tcs, tag_playcount); + id3->lastplayed = tagcache_get_numeric(&tcs, tag_lastplayed); + id3->rating = tagcache_get_numeric(&tcs, tag_virt_autoscore) / 10; + + tagcache_search_finish(&tcs); } static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track) diff --git a/firmware/export/id3.h b/firmware/export/id3.h index 218db64..7930cd9 100644 --- a/firmware/export/id3.h +++ b/firmware/export/id3.h @@ -109,9 +109,7 @@ struct mp3entry { long rundbentryoffset; /* runtime database fields */ - long rundbhash; short rating; - short voladjust; long playcount; long lastplayed; |