Skip to content

Commit

Permalink
Better subtitle language matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrews54757 committed Dec 2, 2023
1 parent e04e39e commit 439b1c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chrome/player/ui/subtitles/SubtitlesManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ export class SubtitlesManager {
}

const defLang = this.settingsManager.getSettings()['default-lang'];
if (autoset && this.client.options.autoEnableBestSubtitles && subtitleTrack.language === defLang && this.activeTracks.length === 0) {
this.activateTrack(subtitleTrack);
if (autoset && this.activeTracks.length === 0 && this.client.options.autoEnableBestSubtitles) {
if (subtitleTrack.language && subtitleTrack.language.substring(0, defLang.length) === defLang) {
this.activateTrack(subtitleTrack);
}
}

return returnedTrack;
Expand Down

0 comments on commit 439b1c6

Please sign in to comment.