Skip to content

Commit

Permalink
fix: also use label when filtering audios by language
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalygashkov committed Dec 17, 2024
1 parent 51f20a5 commit e66e322
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ const createAudioLanguageFilter = (audios) => {
}
const results = [];
const filteredLanguages = [
...new Set(filtered.map((track) => track.language)),
...new Set(filtered.map((track) => `${track.language}:${track.label}`)),
];
for (const language of filteredLanguages) {
const tracks = filtered
.filter((track) => track.language === language)
.filter((track) => `${track.language}:${track.label}` === language)
.slice(0, maxTracksPerLanguage);
results.push(...tracks);
}
Expand Down

0 comments on commit e66e322

Please sign in to comment.