Skip to content

feat: add total duration, variant and rendition helpers - #20

Merged
includeamin merged 1 commit into
mainfrom
feat/playlist-helpers
Nov 21, 2026
Merged

includeamin merged 1 commit into
mainfrom
feat/playlist-helpers

Conversation

@includeamin

Copy link
Copy Markdown
Owner

Summary

  • Add Playlist::total_duration(), the sum of EXTINF durations (GAP segments still count)
  • Add Playlist::variants() and variants_by_bandwidth(), returning owned Variant values that pair each EXT-X-STREAM-INF with its URI line (stable sort, lowest to highest bandwidth)
  • Add Playlist::renditions() and renditions_in_group(type_, group_id), returning owned Rendition values from EXT-X-MEDIA
  • Module docs and README feature entry

Notes

  • Additive, not breaking.
  • A stream tag with no URI after it is skipped by variants(); validation still reports it.
  • media_segments() is unchanged, since returning an iterator would break callers that index into it.

Test plan

  • cargo test (95 unit + 5 doc tests)
  • cargo clippy --all-targets

@includeamin
includeamin merged commit 9fbb258 into main Nov 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant