Skip to content

fix: subtitle casing#60

Merged
omgate234 merged 1 commit into
mainfrom
fix/subtitle-casing
Jun 3, 2026
Merged

fix: subtitle casing#60
omgate234 merged 1 commit into
mainfrom
fix/subtitle-casing

Conversation

@omgate234
Copy link
Copy Markdown
Collaborator

Pull Request

Description:
Fix Video.addSubtitle so subtitle styles actually reach the backend. The method was sending camelCase keys under
subtitle_style and had no defaults, so any caller config was silently ignored by the API and addSubtitle() with no args sent
subtitle_style: {}. Now it merges the SDK's existing SubtitleStyleDefaultValues and converts keys to snake_case before
posting, matching the HttpClient contract and the Python SDK's behavior.

Changes:

  • Bugfix: convert subtitle_style payload from camelCase → snake_case via fromCamelToSnake in Video.addSubtitle
    (src/core/video.ts)
  • Bugfix: apply SubtitleStyleDefaultValues when addSubtitle is called with no config or a partial config, so the request
    mirrors videodb-python's SubtitleStyle() dataclass defaults
  • Imports: pull in fromCamelToSnake from @/utils and SubtitleStyleDefaultValues from @/core/config

Related Issues:

  • Closes #

Testing:

  • Manually invoked video.addSubtitle() (no args) and verified the outbound request body contains snake_case keys (font_name,
    primary_colour, border_style, margin_l, …) populated from SubtitleStyleDefaultValues, and that the call returns a valid
    streamUrl.
  • Manually invoked video.addSubtitle({ fontName: "Inter", fontSize: 24, marginV: 40 }) and verified the partial overrides
    merge over the defaults and serialize as font_name, font_size, margin_v while the rest of the defaults are still sent.
    confirm CLI-supplied flags now actually take effect.
  • npx tsc --noEmit passes.

Checklist:

  • Code follows project coding standards
  • Tests have been added or updated
  • Code Review
  • Manual test after merge
  • All checks passed

@omgate234 omgate234 merged commit b5322fb into main Jun 3, 2026
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