You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lofty/src/id3/v2/tag.rs
+15-17Lines changed: 15 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -76,35 +76,33 @@ macro_rules! impl_accessor {
76
76
///
77
77
/// In the [`Accessor`] methods, these values have the separators (`\0`) replaced with `"/"` for convenience.
78
78
///
79
+
/// ## Special Frames
80
+
///
81
+
/// ID3v2 has `GEOB` and `SYLT` frames, which are not parsed by default, instead storing them as [`FrameType::Binary`].
82
+
/// They can easily be parsed with [`GeneralEncapsulatedObject::parse`](crate::id3::v2::GeneralEncapsulatedObject::parse)
83
+
/// and [`SynchronizedText::parse`](crate::id3::v2::SynchronizedTextFrame::parse) respectively, and converted back to binary with
84
+
/// [`GeneralEncapsulatedObject::as_bytes`](crate::id3::v2::GeneralEncapsulatedObject::as_bytes) and
85
+
/// [`SynchronizedText::as_bytes`](crate::id3::v2::SynchronizedTextFrame::as_bytes) for writing.
86
+
///
79
87
/// ## Conversions
80
88
///
81
-
/// ⚠ **Warnings** ⚠
89
+
/// ### To `Tag`
90
+
///
91
+
/// * TXXX/WXXX
92
+
/// * These frames map to [`ItemKey`] by their description, rather than their frame ID (e.g. `TXXX:REPLAYGAIN_ALBUM_GAIN` maps to [`ItemKey::ReplayGainAlbumGain`]).
93
+
/// * Anything without a mapping will be discarded.
94
+
/// * POPM - These frames will be stored as a raw [`ItemValue::Binary`] value under the [`ItemKey::Popularimeter`] key.
82
95
///
83
96
/// ### From `Tag`
84
97
///
85
98
/// When converting from a [`Tag`] to an `Id3v2Tag`, some frames may need editing.
86
99
///
87
100
/// * [`ItemKey::Comment`] and [`ItemKey::Lyrics`] - Unlike a normal text frame, these require a language and description.
88
101
/// * If these values aren't specified in the [`TagItem`], it will be filled in with (possibly incorrect) defaults.
89
-
/// * `language` - Unknown and set to "XXX"
102
+
/// * `language` - Set to [`UNKNOWN_LANGUAGE`]
90
103
/// * `description` - Left empty, which is invalid if there are more than one of these frames. These frames can only be identified
91
104
/// by their descriptions, and as such they are expected to be unique for each.
92
105
/// * See [`CommentFrame`] and [`UnsynchronizedTextFrame`] respectively.
93
-
///
94
-
/// ### To `Tag`
95
-
///
96
-
/// * TXXX/WXXX - These frames will be stored as an [`ItemKey`] by their description. Some variants exist
97
-
/// for these descriptions, such as [`ItemKey::ReplayGainAlbumGain`]. Anything without a mapping will
98
-
/// be discarded.
99
-
/// * POPM - These frames will be stored as a raw [`ItemValue::Binary`] value under the [`ItemKey::Popularimeter`] key.
100
-
///
101
-
/// ## Special Frames
102
-
///
103
-
/// ID3v2 has `GEOB` and `SYLT` frames, which are not parsed by default, instead storing them as [`FrameType::Binary`].
104
-
/// They can easily be parsed with [`GeneralEncapsulatedObject::parse`](crate::id3::v2::GeneralEncapsulatedObject::parse)
105
-
/// and [`SynchronizedText::parse`](crate::id3::v2::SynchronizedTextFrame::parse) respectively, and converted back to binary with
106
-
/// [`GeneralEncapsulatedObject::as_bytes`](crate::id3::v2::GeneralEncapsulatedObject::as_bytes) and
107
-
/// [`SynchronizedText::as_bytes`](crate::id3::v2::SynchronizedTextFrame::as_bytes) for writing.
0 commit comments