mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Remove duplicated subtitles on archive audio merge
This commit is contained in:
parent
bd20c5a7b6
commit
c97adb3ce7
2 changed files with 25 additions and 3 deletions
|
|
@ -446,7 +446,15 @@ impl Filter for ArchiveFilter {
|
|||
.iter()
|
||||
.map(|d| (d.audio.clone(), d.format.audio.clone()))
|
||||
.collect(),
|
||||
subtitles: data.iter().map(|d| d.subtitles.clone()).flatten().collect(),
|
||||
// mix all subtitles together and then reduce them via a map so that only one
|
||||
// subtitle per language exists
|
||||
subtitles: data
|
||||
.iter()
|
||||
.flat_map(|d| d.subtitles.clone())
|
||||
.map(|s| (s.locale.clone(), s))
|
||||
.collect::<HashMap<Locale, Subtitle>>()
|
||||
.into_values()
|
||||
.collect(),
|
||||
}),
|
||||
MergeBehavior::Auto => {
|
||||
let mut download_formats: HashMap<Duration, DownloadFormat> = HashMap::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue