[Feature] playlist_viewer id3 title display

Not sure this is a great idea from disk and battery standpoint
but there is no reason you can't..

using the name buffer to fill title data
prevent hitting the disk for each screen scroll

add get_metadata_ex to allow flags
 METADATA_EXCLUDE_ID3_PATH
  prevent copying the filename to the ID3 struct
 METADATA_CLOSE_FD_ON_EXIT
  instead of seeking to the beginning the file is closed before
  get_metadata returns

add logic to allow a invalid fd to signal that get_metadata
should open and close the file within its call

bugfix per Chris_s don't use the tagcache for the trackinfo

Change-Id: Ic7a595b39a8d7a57f975312bc9c8bb4111f22a88
This commit is contained in:
William Wilgus 2024-07-05 17:13:10 -04:00 committed by William Wilgus
parent 07cf874191
commit fdbaf7df59
9 changed files with 145 additions and 89 deletions

View file

@ -652,11 +652,9 @@ static bool buffer_handle(int handle_id, size_t to_buffer)
trigger_cpu_boost();
if (h->type == TYPE_ID3) {
if (!get_metadata(ringbuf_ptr(h->data), h->fd, h->path)) {
/* metadata parsing failed: clear the buffer. */
wipe_mp3entry(ringbuf_ptr(h->data));
}
close_fd(&h->fd);
get_metadata_ex(ringbuf_ptr(h->data),
h->fd, h->path, METADATA_CLOSE_FD_ON_EXIT);
h->fd = -1; /* with above, behavior same as close_fd */
h->widx = ringbuf_add(h->data, h->filesize);
h->end = h->filesize;
send_event(BUFFER_EVENT_FINISHED, &handle_id);