Added subtitle track duration to manual search to tell same-language tracks apart#3416
Open
andersonviudes wants to merge 2 commits into
Open
Conversation
…tracks apart The embedded subtitles provider surfaced the same release info for every track sharing a language, since the only distinguishing text came from stream/container naming. When an MKV has multiple tracks in the same language, manual search showed indistinguishable entries. - embeddedsubtitles.py: expose an extra_release_info list on EmbeddedSubtitle, populated from the per-track MKV DURATION tag (falling back to the language-suffixed DURATION-eng tag, then the container duration) so tracks with different lengths show a "Duration: h:mm:ss" hint. - manual.py: factor release info assembly into _build_release_info() and append extra_release_info so the new hint reaches the manual search results.
… vendored libs pyproject.toml was untracked locally with the ruff config (excluding libs/, custom_libs/, frontend/, migrations/); adding it so other contributors' `ruff check .` matches the excludes described in AGENTS.md instead of linting vendored code.
8a7b1ca to
684437d
Compare
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.
Summary
DURATIONtag (falling back to the language-suffixedDURATION-engtag, then the container duration) and surfaces it asDuration: h:mm:ssin the release info shown to the user.manual.pyinto_build_release_info()to make room for the new hint; no behavior change for existing single-track-per-language cases.Context
When an MKV has multiple subtitle tracks in the same language,
embeddedsubtitles.pyonly exposedstream.duration, which reflects the container's total duration for every stream — so every same-language track looked identical in manual search, with nothing to tell them apart.Per-track MKV
DURATIONtags actually differ between tracks and are the right signal here. For same-language tracks, mkvmerge/ffprobe often reports this tag language-suffixed instead (e.g.DURATION-eng), which the vendoredfeselibrary already exposes asstream.tags.duration_eng(mirroring how it already falls back fornumber_of_frames/number_of_frames_eng). The fix stays fully scoped to Bazarr's owncustom_libs/subliminal_patch/providers/embeddedsubtitles.py— no changes to vendoredlibs/fese/*.#Exemple:

Test plan
test_get_extra_release_info_mkv_tag_duration_wins_over_container_durationandtest_get_extra_release_info_mkv_language_suffixed_tag_wins_over_container_durationintests/subliminal_patch/test_embeddedsubtitles.py, plus coverage for_build_release_info()in the newtests/bazarr/test_subtitles_manual.py.pytest tests/subliminal_patch/test_embeddedsubtitles.py tests/bazarr/test_subtitles_manual.py→ 45 passed (2 pre-existing, unrelated failures in the same file untouched by this change).no log:commit addingrufftodev-requirements.txt+ apyproject.tomlexcludinglibs//custom_libs//frontend//migrations/, soruff check .doesn't lint vendored code for other contributors.