feat(songLyrics): add cue byte offsets#228
feat(songLyrics): add cue byte offsets#228ranokay wants to merge 2 commits intoopensubsonic:mainfrom
Conversation
✅ Deploy Preview for opensubsonic ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates the songLyrics v2 (enhanced) cue model documentation and OpenAPI schemas to support optional byteStart / byteEnd UTF-8 byte offsets on cues, allowing clients to disambiguate repeated timed/untimed text within a cueLine.value.
Changes:
- Add
byteStart/byteEndfields to thecueOpenAPI schema and document their contract (all-or-none, relative tocueLine.value, inclusive, UTF-8, no normalization,byteStart <= byteEnd). - Propagate the new offset semantics through related OpenAPI descriptions (
structuredLyrics,cueLine,getLyricsBySongId). - Add/extend docs and examples showing how offsets disambiguate repeated tokens.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| openapi/schemas/StructuredLyrics.json | Notes that cues may include byte offsets into cueLine.value in enhanced synced responses. |
| openapi/schemas/CueLine.json | Documents cueLine.value requirement when any nested cue uses byte offsets and references offsets in cue. |
| openapi/schemas/Cue.json | Adds byteStart / byteEnd properties with minimum bounds and detailed contract descriptions. |
| openapi/endpoints/getLyricsBySongId.json | Updates enhanced parameter descriptions to mention optional cue byte offsets. |
| content/en/docs/Responses/structuredLyrics.md | Documents offsets at the structuredLyrics v2 level and clarifies offset scope. |
| content/en/docs/Responses/cueLine.md | Adds an example showing ambiguous repeated text disambiguation and updates field details. |
| content/en/docs/Responses/cue.md | Adds an example and contract note for byteStart / byteEnd. |
| content/en/docs/Extensions/songLyrics.md | Updates extension feature list and defines offset semantics. |
| content/en/docs/Endpoints/getLyricsBySongId.md | Updates parameter docs, adds an ambiguous-text example, and documents offset invariants in implementation notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Do we want that optional ? |
|
Maybe keep them optional in the schema, but conditionally required by the spec? If cue order + That fixes the repeated timed/untimed token case without forcing every server to emit byte offsets for all cues. |
|
The thing is that if the server needs to be able to handle this case it means it can emit those. Making that optional means that servers must find if there's duplicates or not and if emitting or not, and clients needs to handle both the case with or without those. This only brings complexity on both ends for no gain, it's actually better to enforce it so every one handle only one case. |
|
Gotcha. If we do that, |
|
It's already required in your spec no ? |
|
No, not currently. It’s only conditionally required when byte offsets are emitted. |
|
I looked at the wrong value. Yes value should be required |
Summary
This follow-up amends the
songLyricsv2 cue model to disambiguate repeated timed/untimed text within acueLine.value.It adds optional
byteStart/byteEndfields oncue, defined as 0-based inclusive UTF-8 byte offsets into the final parentcueLine.value, with no normalization step.Changes
byteStart/byteEndto thecuedocs and OpenAPI schemacueLine.valuebyteStart <= byteEndcueLine,structuredLyrics,songLyrics, andgetLyricsBySongId