ID3v2: Handle TXXX ItemKey conversions correctly

This commit is contained in:
Serial 2024-09-09 07:52:53 -04:00 committed by Alex
parent da4dea1f8b
commit c629e0e4bd
2 changed files with 7 additions and 3 deletions

View file

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- **MusePack**: Fix potential panic when the beginning silence makes up the entire sample count ([PR](https://github.com/Serial-ATA/lofty-rs/pull/449)) - **MusePack**: Fix potential panic when the beginning silence makes up the entire sample count ([PR](https://github.com/Serial-ATA/lofty-rs/pull/449))
- **Timestamp**: Support timestamps without separators (ex. "20240906" vs "2024-09-06") ([issue](https://github.com/Serial-ATA/lofty-rs/issues/452)) ([PR](https://github.com/Serial-ATA/lofty-rs/issues/453)) - **Timestamp**: Support timestamps without separators (ex. "20240906" vs "2024-09-06") ([issue](https://github.com/Serial-ATA/lofty-rs/issues/452)) ([PR](https://github.com/Serial-ATA/lofty-rs/issues/453))
- **ID3v2**: `ItemKey::Director` will now be written correctly as a TXXX frame ([PR](https://github.com/Serial-ATA/lofty-rs/issues/454))
## [0.21.1] - 2024-08-28 ## [0.21.1] - 2024-08-28

View file

@ -1379,7 +1379,6 @@ impl MergeTag for SplitTagRemainder {
&ItemKey::Composer, &ItemKey::Composer,
&ItemKey::Conductor, &ItemKey::Conductor,
&ItemKey::Writer, &ItemKey::Writer,
&ItemKey::Director,
&ItemKey::Lyricist, &ItemKey::Lyricist,
&ItemKey::MusicianCredits, &ItemKey::MusicianCredits,
&ItemKey::InternetRadioStationName, &ItemKey::InternetRadioStationName,
@ -1403,8 +1402,11 @@ impl MergeTag for SplitTagRemainder {
} }
// Multi-valued TXXX key-to-frame mappings // Multi-valued TXXX key-to-frame mappings
#[allow(clippy::single_element_loop)] for item_key in [
for item_key in [&ItemKey::TrackArtists] { &ItemKey::TrackArtists,
&ItemKey::Director,
&ItemKey::CatalogNumber,
] {
let frame_id = item_key let frame_id = item_key
.map_key(TagType::Id3v2, false) .map_key(TagType::Id3v2, false)
.expect("valid frame id"); .expect("valid frame id");
@ -1521,6 +1523,7 @@ impl MergeTag for SplitTagRemainder {
)); ));
} }
// iTunes advisory rating
'rate: { 'rate: {
if let Some(advisory_rating) = tag.take_strings(&ItemKey::ParentalAdvisory).next() { if let Some(advisory_rating) = tag.take_strings(&ItemKey::ParentalAdvisory).next() {
let Ok(rating) = advisory_rating.parse::<u8>() else { let Ok(rating) = advisory_rating.parse::<u8>() else {