Skip to content

fix(api): keep subtitle cues continuous across export pages (#1472) - #1473

Draft
SamanPandey-in wants to merge 1 commit into
fossasia:devfrom
SamanPandey-in:fix/1472-paginated-subtitle-timeline
Draft

SamanPandey-in wants to merge 1 commit into
fossasia:devfrom
SamanPandey-in:fix/1472-paginated-subtitle-timeline

Conversation

@SamanPandey-in

@SamanPandey-in SamanPandey-in commented Dec 4, 2026 •

Copy link
Copy Markdown

Description

Paginated VTT and SRT exports restart at cue 1 and time zero on every page. The last cue on a page can also extend past the next page's first cue, so clients following X-Next-Cursor cannot assemble a continuous subtitle file.

This PR keeps cue timing and numbering aligned across pages. It uses the extra row already fetched for pagination to end a boundary cue at the next segment's start. A continuation reads the first matching segment and counts earlier matching cues in the same export window.

Related Issue

Closes #1472. Follow-up to #1464. This PR starts from the current dev branch and stays in draft while that snapshot export PR is open.

Changes Made

  • Keep VTT and SRT cue numbers and playback offsets continuous across cursor pages.
  • Use the next matching row as lookahead for the last cue on a page.
  • Apply the same behavior to translated exports and document the cursor flow.
  • Add regression tests for both formats, translated rows, and a filtered window.

Testing

  • Tested locally
  • Focused export tests: 41 passed
  • Ruff check, format check, and git diff check passed
  • Broad suite: 3,818 passed and 17 skipped in the sandbox. Three failures and 14 setup errors were in tests that bind localhost sockets. All affected test files passed when rerun with localhost access: 30 passed.
  • Verified through the running VoxBento app with disposable SQLite data and an event-scoped OAuth token

The live API returned VTT and SRT cues 1, 2, 3 at 00:00:00, 00:00:02, and 00:00:04. The first two cues end when the next starts.

Screenshots / Video

Short product walkthrough (9 seconds). It starts in VoxBento's stored transcript viewer, then follows the real export endpoint through three VTT pages and three SRT pages with URL-encoded cursors.

Stored transcript in the product:

VoxBento transcript viewer with three stored segments

VTT continuation:

VTT page two with cue two at two seconds

SRT continuation:

SRT page two with cue two at two seconds

Checklist

  • My code follows the project's coding standards
  • I have tested my changes
  • I have updated documentation where necessary
  • My changes do not introduce new warnings or errors in the focused checks

Additional Notes

@ArnavBallinCode @VineetRamshetty: I implemented the shared timeline proposed in #1472. I am happy to adjust the contract if you prefer standalone subtitle fragments.

This draft needs a compatibility pass after #1464 lands. Its opaque snapshot cursors should derive the origin and cue position from frozen rows, since counting live rows would drift after later commits. #1467 changes cue-duration handling in the same serializers, so I will reconcile that diff before requesting review.

Copilot AI balanced review requested due to automatic review settings December 4, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sourcery-ai

sourcery-ai Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

API

Extend paginated transcript exports so continuation pages retain the export window’s playback origin and cue numbering, and pass the next row through as lookahead for boundary timing.

  • portal/routers/api_v1.py L1564-1616 (+3 small edits)

Implementation

Update the VTT and SRT serializers to accept a starting cue number and optional next cue, keeping numbering and boundary durations continuous.

  • portal/routers/api_v1.py L1293-1299 (+5 small edits)

Documentation

Document how clients follow export cursors and how paginated subtitle timing and cue numbering behave.

  • website/docs/api/overview.mdx L45-46

Tests

Add regression coverage for continuous paginated subtitle timing and numbering across formats, translations, and a filtered export window.

  • tests/test_api_v1_transcription.py L893-964

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@SamanPandey-in

Copy link
Copy Markdown
Author

Keeping this PR in draft while #1464 and #1467 are still open. The current fix calculates the subtitle origin and cue position from live transcript rows. After #1464's snapshot export lands, continuations need to derive those values from the frozen rows so later commits cannot shift timing or numbering. I also need to reconcile #1467's changes to the same subtitle serializers and rerun the focused tests before marking this ready for review.

This branch has not been deployed

No deployments
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.

Paginated VTT and SRT exports reset cue timing and numbering

2 participants