Skip to content

Commit

Permalink
Add accessors to SegmentTags and MediaPlaylistTags
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfish-shogi committed Dec 20, 2024
1 parent fc17a45 commit dc082a0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions media_playlist_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ func (tags MediaPlaylistTags) Raw() Tags {
return Tags(tags)
}

// First returns the first tag of the name.
func (tags MediaPlaylistTags) First(name string) *Tag {
return tags.Raw().First(name)
}

// Last returns the last tag of the name.
func (tags MediaPlaylistTags) Last(name string) *Tag {
return tags.Raw().Last(name)
}

// Set sets the tag.
// If the tag already exists, it will be overwritten.
func (tags MediaPlaylistTags) Set(tag *Tag) {
Expand Down
10 changes: 10 additions & 0 deletions segment_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ func (tags SegmentTags) Raw() Tags {
return Tags(tags)
}

// First returns the first tag of the name.
func (tags SegmentTags) First(name string) *Tag {
return tags.Raw().First(name)
}

// Last returns the last tag of the name.
func (tags SegmentTags) Last(name string) *Tag {
return tags.Raw().Last(name)
}

// Set sets the tag.
// If the tag already exists, it will be overwritten.
func (tags SegmentTags) Set(tag *Tag) {
Expand Down

0 comments on commit dc082a0

Please sign in to comment.