Skip to content

Find best match (subtitles)#446

Merged
ProdigyV21 merged 12 commits into
ProdigyV21:mainfrom
silentbil:find_best_match
Jul 9, 2026
Merged

Find best match (subtitles)#446
ProdigyV21 merged 12 commits into
ProdigyV21:mainfrom
silentbil:find_best_match

Conversation

@silentbil

Copy link
Copy Markdown
Collaborator

Auto Find Best Subtitle Match

Automatically selects the best-synced subtitle from your addons instead of a
blind release-name guess. It compares each candidate's cue timing against the
video's built-in subtitle track (or, when there's none, AI audio transcription)
and picks the one that actually lines up — falling back to AI translation or the
top release-name match if nothing is well-synced.

Highlights

  • Timing-based matching — no API key required for the core scan; works off
    the built-in reference track.
  • Per-stream cache — a confirmed match is remembered per file (by
    infoHash/videoHash/filename), so replays are instant. Keyed to the exact file,
    not the title, so a different source re-scans.
  • Lives under Settings → Subtitles, independent of the AI translation
    feature. Off by default — opt in per taste.
  • Manual "Find Best Match" entry in the player subtitle menu (forces a fresh
    scan, ignoring the cache).

Also included

  • AIOStreams support: keep the addon's own stream order, parallel subtitle fetch
    with retry (slow/502 endpoints), and correct VTT handling for …/sub.vtt/ URLs.

@ProdigyV21

Copy link
Copy Markdown
Owner

This is a really strong feature and I like the direction. I tested the merge locally: it merges cleanly, git diff --check passes, and both Play/Sideload Kotlin compiles pass.

One question, not sure if its intended or not. Any running Find Best Match scans when a new media item starts loading. findBestSubtitleMatch() captures the previous subtitle and can keep running for a while, but loadMedia() currently cancels subtitle/stream jobs without cancelling findMatchJob. If the user leaves the current title while a scan is active, the old scan can later restore/select a stale subtitle on the new playback session.

@silentbil

Copy link
Copy Markdown
Collaborator Author

@ProdigyV21 good catch!
fixed

@ProdigyV21 ProdigyV21 merged commit 62ad561 into ProdigyV21:main Jul 9, 2026
7 of 8 checks passed
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