mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Mark CC subtitle track as CC & grab normal subtitles and CC when using -m audio (#141)
This commit is contained in:
parent
c0e2df4804
commit
847c6a1abc
4 changed files with 38 additions and 26 deletions
|
|
@ -242,10 +242,16 @@ async fn get_format(
|
|||
}
|
||||
};
|
||||
|
||||
let subtitles: Vec<Subtitle> = archive
|
||||
let subtitles: Vec<(Subtitle, bool)> = archive
|
||||
.subtitle
|
||||
.iter()
|
||||
.filter_map(|s| stream.subtitles.get(s).cloned())
|
||||
.filter_map(|s| {
|
||||
stream
|
||||
.subtitles
|
||||
.get(s)
|
||||
.cloned()
|
||||
.map(|l| (l, single_format.audio == Locale::ja_JP))
|
||||
})
|
||||
.collect();
|
||||
|
||||
format_pairs.push((single_format, video.clone(), audio, subtitles.clone()));
|
||||
|
|
@ -278,9 +284,6 @@ async fn get_format(
|
|||
subtitles: format_pairs
|
||||
.iter()
|
||||
.flat_map(|(_, _, _, subtitles)| subtitles.clone())
|
||||
.map(|s| (s.locale.clone(), s))
|
||||
.collect::<HashMap<Locale, Subtitle>>()
|
||||
.into_values()
|
||||
.collect(),
|
||||
}),
|
||||
MergeBehavior::Auto => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue