Serial-ATA / lofty-rs

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

Add Tag::take_filter() #414

Closed uklotzde closed 17 hours ago

uklotzde commented 2 days ago

The behavior of the take_string() and other string accessor methods has changed in lofty v0.20.0. They now return values from all TagItems, regardless of their description. This is unexpected for ID3v2 tags where the description is meaningful. Regular TagItems usually have an empty description.

The new methods are needed to extract only regular TagItems with an empty description from an ID3v2 tag. The example demonstrates how to achieve this for ItemKey::Comment.

uklotzde commented 2 days ago

I have added some comments. Preserving the order of all items while splitting them is an important feature.