feat(tracks): add subtitle.dedupe_codecs to keep one codec per subtitle variant

This commit is contained in:
imSp4rky
2026-10-31 16:35:01 -06:00
parent 65e807bf5f
commit f9c1c3d390
5 changed files with 52 additions and 3 deletions
+4
View File
@@ -2453,6 +2453,10 @@ class dl:
level="INFO", operation="get_tracks", service=self.service, context=tracks_info
)
if dedupe_codecs := config.subtitle.get("dedupe_codecs"):
codecs = map(SUBTITLE_CODEC.convert, dedupe_codecs)
title.tracks.dedupe_subtitle_codecs([c for c in codecs if isinstance(c, Subtitle.Codec)])
# a plain track covers an SDH track only when it is the same variant, as -sl selects them,
# so en-US SDH is stripped next to a plain en-GB: -sl en-US would otherwise keep only the SDH
if config.subtitle.get("strip_sdh", True):