Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- In formats like Vorbis Comments, `ItemKey::Lyrics` may actually contain synchronized lyrics in LRC format. To help with the ambiguity, some
apps may write a separate field containing normal, unsynchronized lyrics.
- In other formats where the difference doesn't matter (like ID3v2), this will act exactly the same as `ItemKey::Lyrics`.
- `ItemKey::ReleaseCountry` ([PR](https://github.com/Serial-ATA/lofty-rs/pull/573))
- Currently, this maps to the [fields](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html#id30) used by MusicBrainz Picard, which expect an
ISO 3166-1 code.
- **Serde**: [Serde] support for `*Type` enums (`FileType`, `TagType`, `PictureType`)
- Support can be enabled with the new `serde` feature (not enabled by default)
- **Probe**: `Probe::read_bound()` ([PR](https://github.com/Serial-ATA/lofty-rs/pull/557))
Expand Down
1 change: 1 addition & 0 deletions lofty/src/id3/v2/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,7 @@ impl MergeTag for SplitTagRemainder {
ItemKey::MusicBrainzArtistId,
ItemKey::MusicBrainzReleaseArtistId,
ItemKey::MusicBrainzWorkId,
ItemKey::ReleaseCountry,
] {
let frame_id = item_key.map_key(TagType::Id3v2).expect("valid frame id");
if let Some(text) = join_text_items(&mut tag, [item_key]) {
Expand Down
164 changes: 85 additions & 79 deletions lofty/src/tag/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ gen_map!(
"MOVEMENTNAME" => Movement,
"MOVEMENT" => MovementNumber,
"MOVEMENTTOTAL" => MovementTotal,
"RELEASECOUNTRY" => ReleaseCountry,
"ALBUMSORT" => AlbumTitleSortOrder,
"ALBUMARTISTSORT" => AlbumArtistSortOrder,
"TITLESORT" => TrackTitleSortOrder,
Expand Down Expand Up @@ -244,91 +245,93 @@ gen_map!(
"MusicBrainz Release Group Id" => MusicBrainzReleaseGroupId,
"MusicBrainz Artist Id" => MusicBrainzArtistId,
"MusicBrainz Album Artist Id" => MusicBrainzReleaseArtistId,
"MusicBrainz Work Id" => MusicBrainzWorkId
"MusicBrainz Work Id" => MusicBrainzWorkId,
"MusicBrainz Album Release Country" => ReleaseCountry
);

gen_map!(
ILST_MAP;

"\u{a9}alb" => AlbumTitle,
"----:com.apple.iTunes:DISCSUBTITLE" => SetSubtitle,
"tvsh" => ShowName,
"\u{a9}grp" => ContentGroup,
"\u{a9}nam" => TrackTitle,
"----:com.apple.iTunes:SUBTITLE" => TrackSubtitle,
"\u{a9}wrk" => Work,
"\u{a9}mvn" => Movement,
"\u{a9}mvi" => MovementNumber,
"\u{a9}mvc" => MovementTotal,
"soal" => AlbumTitleSortOrder,
"soaa" => AlbumArtistSortOrder,
"sonm" => TrackTitleSortOrder,
"soar" => TrackArtistSortOrder,
"sosn" => ShowNameSortOrder,
"soco" => ComposerSortOrder,
"aART" => AlbumArtist,
"----:com.apple.iTunes:ALBUMARTISTS" => AlbumArtists,
"\u{a9}ART" => TrackArtist,
"----:com.apple.iTunes:ARTISTS" => TrackArtists,
"\u{a9}wrt" => Composer,
"\u{a9}dir" => Director,
"----:com.apple.iTunes:CONDUCTOR" => Conductor,
"----:com.apple.iTunes:ENGINEER" => Engineer,
"----:com.apple.iTunes:LYRICIST" => Lyricist,
"----:com.apple.iTunes:DJMIXER" => MixDj,
"----:com.apple.iTunes:MIXER" => MixEngineer,
"----:com.apple.iTunes:PRODUCER" => Producer,
"----:com.apple.iTunes:LABEL" => Label,
"----:com.apple.iTunes:REMIXER" => Remixer,
"disk" => DiscNumber,
"disk" => DiscTotal,
"trkn" => TrackNumber,
"trkn" => TrackTotal,
"rate" => Popularimeter,
"rtng" => ParentalAdvisory,
"\u{a9}day" => RecordingDate,
"----:com.apple.iTunes:ORIGINALDATE" => OriginalReleaseDate, // TagLib v2.0
"----:com.apple.iTunes:RELEASEDATE" => ReleaseDate,
"----:com.apple.iTunes:ISRC" => Isrc,
"----:com.apple.iTunes:BARCODE" => Barcode,
"----:com.apple.iTunes:CATALOGNUMBER" => CatalogNumber,
"cpil" => FlagCompilation,
"pcst" => FlagPodcast,
"----:com.apple.iTunes:MEDIA" => OriginalMediaType,
"\u{a9}enc" => EncodedBy,
"\u{a9}too" => EncoderSoftware,
"\u{a9}gen" => Genre,
"----:com.apple.iTunes:COLOR" => Color,
"----:com.apple.iTunes:MOOD" => Mood,
"tmpo" => IntegerBpm,
"----:com.apple.iTunes:BPM" => Bpm,
"----:com.apple.iTunes:initialkey" => InitialKey,
"----:com.apple.iTunes:replaygain_album_gain" => ReplayGainAlbumGain,
"----:com.apple.iTunes:replaygain_album_peak" => ReplayGainAlbumPeak,
"----:com.apple.iTunes:replaygain_track_gain" => ReplayGainTrackGain,
"----:com.apple.iTunes:replaygain_track_peak" => ReplayGainTrackPeak,
"cprt" => CopyrightMessage,
"----:com.apple.iTunes:LICENSE" => License,
"ldes" => PodcastDescription,
"catg" => PodcastSeriesCategory,
"purl" => PodcastUrl,
"egid" => PodcastGlobalUniqueId,
"keyw" => PodcastKeywords,
"\u{a9}cmt" => Comment,
"desc" => Description,
"----:com.apple.iTunes:LANGUAGE" => Language,
"----:com.apple.iTunes:SCRIPT" => Script,
"\u{a9}alb" => AlbumTitle,
"----:com.apple.iTunes:DISCSUBTITLE" => SetSubtitle,
"tvsh" => ShowName,
"\u{a9}grp" => ContentGroup,
"\u{a9}nam" => TrackTitle,
"----:com.apple.iTunes:SUBTITLE" => TrackSubtitle,
"\u{a9}wrk" => Work,
"\u{a9}mvn" => Movement,
"\u{a9}mvi" => MovementNumber,
"\u{a9}mvc" => MovementTotal,
"soal" => AlbumTitleSortOrder,
"soaa" => AlbumArtistSortOrder,
"sonm" => TrackTitleSortOrder,
"soar" => TrackArtistSortOrder,
"sosn" => ShowNameSortOrder,
"soco" => ComposerSortOrder,
"aART" => AlbumArtist,
"----:com.apple.iTunes:ALBUMARTISTS" => AlbumArtists,
"\u{a9}ART" => TrackArtist,
"----:com.apple.iTunes:ARTISTS" => TrackArtists,
"\u{a9}wrt" => Composer,
"\u{a9}dir" => Director,
"----:com.apple.iTunes:CONDUCTOR" => Conductor,
"----:com.apple.iTunes:ENGINEER" => Engineer,
"----:com.apple.iTunes:LYRICIST" => Lyricist,
"----:com.apple.iTunes:DJMIXER" => MixDj,
"----:com.apple.iTunes:MIXER" => MixEngineer,
"----:com.apple.iTunes:PRODUCER" => Producer,
"----:com.apple.iTunes:LABEL" => Label,
"----:com.apple.iTunes:REMIXER" => Remixer,
"disk" => DiscNumber,
"disk" => DiscTotal,
"trkn" => TrackNumber,
"trkn" => TrackTotal,
"rate" => Popularimeter,
"rtng" => ParentalAdvisory,
"\u{a9}day" => RecordingDate,
"----:com.apple.iTunes:ORIGINALDATE" => OriginalReleaseDate, // TagLib v2.0
"----:com.apple.iTunes:RELEASEDATE" => ReleaseDate,
"----:com.apple.iTunes:ISRC" => Isrc,
"----:com.apple.iTunes:BARCODE" => Barcode,
"----:com.apple.iTunes:CATALOGNUMBER" => CatalogNumber,
"cpil" => FlagCompilation,
"pcst" => FlagPodcast,
"----:com.apple.iTunes:MEDIA" => OriginalMediaType,
"\u{a9}enc" => EncodedBy,
"\u{a9}too" => EncoderSoftware,
"\u{a9}gen" => Genre,
"----:com.apple.iTunes:COLOR" => Color,
"----:com.apple.iTunes:MOOD" => Mood,
"tmpo" => IntegerBpm,
"----:com.apple.iTunes:BPM" => Bpm,
"----:com.apple.iTunes:initialkey" => InitialKey,
"----:com.apple.iTunes:replaygain_album_gain" => ReplayGainAlbumGain,
"----:com.apple.iTunes:replaygain_album_peak" => ReplayGainAlbumPeak,
"----:com.apple.iTunes:replaygain_track_gain" => ReplayGainTrackGain,
"----:com.apple.iTunes:replaygain_track_peak" => ReplayGainTrackPeak,
"cprt" => CopyrightMessage,
"----:com.apple.iTunes:LICENSE" => License,
"ldes" => PodcastDescription,
"catg" => PodcastSeriesCategory,
"purl" => PodcastUrl,
"egid" => PodcastGlobalUniqueId,
"keyw" => PodcastKeywords,
"\u{a9}cmt" => Comment,
"desc" => Description,
"----:com.apple.iTunes:LANGUAGE" => Language,
"----:com.apple.iTunes:SCRIPT" => Script,
// Don't know of any key for synchronized lyrics, nor if any apps actually support them, so
// just treat both keys the same like ID3v2.
"\u{a9}lyr" => Lyrics | UnsyncLyrics,
"xid " => AppleXid,
"----:com.apple.iTunes:MusicBrainz Track Id" => MusicBrainzRecordingId,
"----:com.apple.iTunes:MusicBrainz Release Track Id" => MusicBrainzTrackId,
"----:com.apple.iTunes:MusicBrainz Album Id" => MusicBrainzReleaseId,
"----:com.apple.iTunes:MusicBrainz Release Group Id" => MusicBrainzReleaseGroupId,
"----:com.apple.iTunes:MusicBrainz Artist Id" => MusicBrainzArtistId,
"----:com.apple.iTunes:MusicBrainz Album Artist Id" => MusicBrainzReleaseArtistId,
"----:com.apple.iTunes:MusicBrainz Work Id" => MusicBrainzWorkId
"\u{a9}lyr" => Lyrics | UnsyncLyrics,
"xid " => AppleXid,
"----:com.apple.iTunes:MusicBrainz Track Id" => MusicBrainzRecordingId,
"----:com.apple.iTunes:MusicBrainz Release Track Id" => MusicBrainzTrackId,
"----:com.apple.iTunes:MusicBrainz Album Id" => MusicBrainzReleaseId,
"----:com.apple.iTunes:MusicBrainz Release Group Id" => MusicBrainzReleaseGroupId,
"----:com.apple.iTunes:MusicBrainz Artist Id" => MusicBrainzArtistId,
"----:com.apple.iTunes:MusicBrainz Album Artist Id" => MusicBrainzReleaseArtistId,
"----:com.apple.iTunes:MusicBrainz Work Id" => MusicBrainzWorkId,
"----:com.apple.iTunes:MusicBrainz Album Release Country" => ReleaseCountry
);

gen_map!(
Expand All @@ -351,7 +354,8 @@ gen_map!(
"IGNR" => Genre,
"ICOP" => CopyrightMessage,
"ICMT" => Comment,
"ILNG" => Language
"ILNG" => Language,
"ICNT" => ReleaseCountry
);

gen_map!(
Expand All @@ -366,6 +370,7 @@ gen_map!(
"MOVEMENTNAME" => Movement,
"MOVEMENT" => MovementNumber,
"MOVEMENTTOTAL" => MovementTotal,
"RELEASECOUNTRY" => ReleaseCountry,
"ALBUMSORT" => AlbumTitleSortOrder,
"ALBUMARTISTSORT" => AlbumArtistSortOrder,
"TITLESORT" => TrackTitleSortOrder,
Expand Down Expand Up @@ -605,6 +610,7 @@ gen_item_keys!(
Movement,
MovementNumber,
MovementTotal,
ReleaseCountry,

///////////////////////////////////////////////////////////////
// MusicBrainz Identifiers
Expand Down