Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m3u8: Finish TODOs in writeDateRange() #19

Open
ollytom opened this issue Jun 4, 2024 · 0 comments
Open

m3u8: Finish TODOs in writeDateRange() #19

ollytom opened this issue Jun 4, 2024 · 0 comments

Comments

@ollytom
Copy link
Member

ollytom commented Jun 4, 2024

Fields of DateRange that we're not writing out as text include:

  • Duration, Planned
  • Custom attributes
  • CueCommand

CueCommand

Need to work out under which conditions to write it out. If CuiIn or CueOut are set, we cannot write out CueCommand as that's invalid.

Another bit of error handling might be to check that CueCommand and/or CueIn/Out have a valid value set in the Splice.Type.

Custom

We'll need a type switch on the value, and error out if we get anything we can't reliably turn into text.
I don't think we'll be able quoted versus unquoted strings. Quick sketch:

switch v.(type) {
case float32:
	return fmt.Sprintf("%03f"...
case string:
	return fmt.Sprintf("%q" ...)
case int:
	return fmt.Sprintf("%d", ...
default:
	return fmt.Errorf("attribute %s: cannot marshal %T to text", v)
}
ollytom added a commit that referenced this issue Jun 6, 2024
In particular: we always need to write ID and Start attributes, and
here are some special rules when EndOnNext is set. This serves as prep for work on

References: #19
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

No branches or pull requests

1 participant