Skip to content

Commit c629e0e

Browse files
committed
ID3v2: Handle TXXX ItemKey conversions correctly
1 parent da4dea1 commit c629e0e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
### Fixed
1616
- **MusePack**: Fix potential panic when the beginning silence makes up the entire sample count ([PR](https://github.com/Serial-ATA/lofty-rs/pull/449))
1717
- **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))
18+
- **ID3v2**: `ItemKey::Director` will now be written correctly as a TXXX frame ([PR](https://github.com/Serial-ATA/lofty-rs/issues/454))
1819

1920
## [0.21.1] - 2024-08-28
2021

lofty/src/id3/v2/tag.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,6 @@ impl MergeTag for SplitTagRemainder {
13791379
&ItemKey::Composer,
13801380
&ItemKey::Conductor,
13811381
&ItemKey::Writer,
1382-
&ItemKey::Director,
13831382
&ItemKey::Lyricist,
13841383
&ItemKey::MusicianCredits,
13851384
&ItemKey::InternetRadioStationName,
@@ -1403,8 +1402,11 @@ impl MergeTag for SplitTagRemainder {
14031402
}
14041403

14051404
// Multi-valued TXXX key-to-frame mappings
1406-
#[allow(clippy::single_element_loop)]
1407-
for item_key in [&ItemKey::TrackArtists] {
1405+
for item_key in [
1406+
&ItemKey::TrackArtists,
1407+
&ItemKey::Director,
1408+
&ItemKey::CatalogNumber,
1409+
] {
14081410
let frame_id = item_key
14091411
.map_key(TagType::Id3v2, false)
14101412
.expect("valid frame id");
@@ -1521,6 +1523,7 @@ impl MergeTag for SplitTagRemainder {
15211523
));
15221524
}
15231525

1526+
// iTunes advisory rating
15241527
'rate: {
15251528
if let Some(advisory_rating) = tag.take_strings(&ItemKey::ParentalAdvisory).next() {
15261529
let Ok(rating) = advisory_rating.parse::<u8>() else {

0 commit comments

Comments
 (0)