8000 feat(import): credit WebVTT voice spans as each line's speaker by adeelahmad · Pull Request #689 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(import): credit WebVTT voice spans as each line's speaker - #689

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: an imported WebVTT transcript kept <v Name> voice tags as text (or dropped them), and every line was left without a speaker, so the people a caption file names had to be assigned by hand.

After: a cue's voice span, <v Name> or <v.class Name>, closed by </v> or not, becomes the line's speaker, and those speakers join the namespace's people like any other named speaker. A cue with two voices becomes two lines that share its time by word count. The tags are left out of the text, and cues without a voice are read as before. A YouTube caption cue starting with a line of one space is no longer lost.

How: the WebVTT reader in domain/ingest.py parses voice spans per cue and splits multi-voice cues.

Motivation and Context

Item from the personal feature plan sheet (bring existing transcripts: <v.class> not parsed).

Screenshots (if appropriate):

n/a

Steps to reproduce (if appropriate):

Import a .vtt file with cues like <v Alice>Hello</v> <v Bob>Hi there: the transcript shows two lines, credited to Alice and Bob.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (tests/domain/test_importing.py).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/processing.md#importing-transcripts).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/vtt-voices.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. Applies to every import path, including the API and MCP imports.
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. Speakers come from the file; no assigning by hand.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. n/a: no settings.
  • Light: default install still runs on a Raspberry Pi with cloud models. Text parsing only.
  • Private and secure: data local and encrypted, passkeys, threat model updated. No new surface; the same import path.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. n/a: no model calls.
  • User decides: consequential or new actions wait for the user; defaults unchanged. Files without voices import as before.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). Applies to new imports only.
  • Honest: sources cited; labelled built, in progress or planned. README built list and docs/requirements.md name the checks.
  • Tests, docs and generated files updated (make openapi). No API change.
  • Open standards; dependencies keep Lens MIT. WebVTT voice spans per the W3C spec; no new dependencies.
  • Result reported with evidence; "refine later" items written down.
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented. Extends the existing WebVTT reader.

Local CI: the container runs several times slower than usual, so I ran the changed tests directly: test_importing.py (8 passed), ruff check and format clean, requirements check passes. GitHub CI decides the merge.


Generated by Claude Code

An imported WebVTT transcript now reads a cue's voice span, <v Name> or
<v.class Name>, closed by </v> or not, as the line's speaker, so the
people a file names join the namespace like other named speakers. A cue
with two voices becomes two lines sharing its time by word count; cues
without a voice are read as before. A YouTube cue starting with a line
of one space is no longer dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
@adeelahmad adeelahmad self-assigned this Oct 19, 2026
@adeelahmad
adeelahmad merged commit 5e13b54 into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 19, 2026 15:17
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.

2 participants

0