fix: subtitle casing#60
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description:
Fix
Video.addSubtitleso subtitle styles actually reach the backend. The method was sending camelCase keys undersubtitle_styleand had no defaults, so any caller config was silently ignored by the API andaddSubtitle()with no args sentsubtitle_style: {}. Now it merges the SDK's existingSubtitleStyleDefaultValuesand converts keys to snake_case beforeposting, matching the
HttpClientcontract and the Python SDK's behavior.Changes:
subtitle_stylepayload from camelCase → snake_case viafromCamelToSnakeinVideo.addSubtitle(
src/core/video.ts)SubtitleStyleDefaultValueswhenaddSubtitleis called with no config or a partial config, so the requestmirrors
videodb-python'sSubtitleStyle()dataclass defaultsfromCamelToSnakefrom@/utilsandSubtitleStyleDefaultValuesfrom@/core/configRelated Issues:
Testing:
video.addSubtitle()(no args) and verified the outbound request body contains snake_case keys (font_name,primary_colour,border_style,margin_l, …) populated fromSubtitleStyleDefaultValues, and that the call returns a validstreamUrl.video.addSubtitle({ fontName: "Inter", fontSize: 24, marginV: 40 })and verified the partial overridesmerge over the defaults and serialize as
font_name,font_size,margin_vwhile the rest of the defaults are still sent.confirm CLI-supplied flags now actually take effect.
npx tsc --noEmitpasses.Checklist: