Skip to content

Commit

Permalink
ID3v2: Cleanup SplitTag impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed May 3, 2024
1 parent 0332d65 commit 833e34e
Show file tree
Hide file tree
Showing 20 changed files with 358 additions and 270 deletions.
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/attached_picture_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ impl<'a> AttachedPictureFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/audio_text_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ impl<'a> AudioTextFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/binary_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ impl<'a> BinaryFrame<'a> {
Self { header, data }
}

/// Get the ID for the frame
pub fn id(&self) -> &FrameId<'_> {
&self.header.id
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/encapsulated_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ impl<'a> GeneralEncapsulatedObject<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/event_timing_codes_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ impl<'a> EventTimingCodesFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/extended_text_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ impl<'a> ExtendedTextFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/extended_url_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ impl<'a> ExtendedUrlFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/key_value_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ impl<'a> KeyValueFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> &FrameId<'_> {
&self.header.id
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
10 changes: 10 additions & 0 deletions lofty/src/id3/v2/items/language_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ impl<'a> CommentFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
Self::FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down Expand Up @@ -229,6 +234,11 @@ impl<'a> UnsynchronizedTextFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
Self::FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/ownership_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ impl<'a> OwnershipFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/popularimeter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ impl<'a> PopularimeterFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/private_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ impl<'a> PrivateFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/relative_volume_adjustment_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ impl<'a> RelativeVolumeAdjustmentFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/sync_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ impl<'a> SynchronizedTextFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/text_information_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ impl<'a> TextInformationFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> &FrameId<'_> {
&self.header.id
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/timestamp_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ impl<'a> TimestampFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> &FrameId<'_> {
&self.header.id
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/unique_file_identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ impl<'a> UniqueFileIdentifierFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> FrameId<'_> {
FRAME_ID
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/id3/v2/items/url_link_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ impl<'a> UrlLinkFrame<'a> {
}
}

/// Get the ID for the frame
pub fn id(&self) -> &FrameId<'_> {
&self.header.id
}

/// Get the flags for the frame
pub fn flags(&self) -> FrameFlags {
self.header.flags
Expand Down
Loading

0 comments on commit 833e34e

Please sign in to comment.