Serial-ATA / lofty-rs

Audio metadata library
Apache License 2.0
182 stars 34 forks source link

ID3v2: Handle genre IDs in TCON frames #286

Closed sublipri closed 8 months ago

sublipri commented 8 months ago

I played around with this and came up with an implementation that returns an iterator and avoids allocation. It seemed appropriate to change the genre getter for the Accessor impl to use the new method so that numeric IDs will be translated and multiple values joined with '/' as per get_text. That's done as a separate commit in case it's a problem.

One question is whether get_texts and get_text should behave the same as genres and genre for TCON frames? I think this could be done fairly cleanly by reworking GenresIter into a more generic MultiValueIter and using it in get_texts. I can add another commit to this PR to address that if necessary.

closes #281

sublipri commented 8 months ago

Reworked the genre commit based on the feedback. Unless I'm missing something re: peekable or there are other problems I think this is okay to merge.

Serial-ATA commented 8 months ago

Yep, looks good to me. Thanks for working on this!