mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Update conditions for subtitle to be marked as CC
This commit is contained in:
parent
94fcf1590a
commit
0f73d8dbec
2 changed files with 10 additions and 3 deletions
|
|
@ -250,7 +250,14 @@ async fn get_format(
|
||||||
.subtitles
|
.subtitles
|
||||||
.get(s)
|
.get(s)
|
||||||
.cloned()
|
.cloned()
|
||||||
.map(|l| (l, single_format.audio == Locale::ja_JP))
|
// the subtitle is probably not cc if the audio is japanese or more than one
|
||||||
|
// subtitle exists for this stream
|
||||||
|
.map(|l| {
|
||||||
|
(
|
||||||
|
l,
|
||||||
|
single_format.audio == Locale::ja_JP || stream.subtitles.len() > 1,
|
||||||
|
)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -205,12 +205,12 @@ async fn get_format(
|
||||||
audios: vec![(audio, single_format.audio.clone())],
|
audios: vec![(audio, single_format.audio.clone())],
|
||||||
subtitles: subtitle
|
subtitles: subtitle
|
||||||
.clone()
|
.clone()
|
||||||
.map_or(vec![], |s| vec![(s, single_format.audio == Locale::ja_JP)]),
|
.map_or(vec![], |s| vec![(s, single_format.audio == Locale::ja_JP || stream.subtitles.len() > 1)]),
|
||||||
};
|
};
|
||||||
let format = Format::from_single_formats(vec![(
|
let format = Format::from_single_formats(vec![(
|
||||||
single_format.clone(),
|
single_format.clone(),
|
||||||
video,
|
video,
|
||||||
subtitle.map_or(vec![], |s| vec![(s, single_format.audio == Locale::ja_JP)]),
|
subtitle.map_or(vec![], |s| vec![(s, single_format.audio == Locale::ja_JP || stream.subtitles.len() > 1)]),
|
||||||
)]);
|
)]);
|
||||||
|
|
||||||
Ok((download_format, format))
|
Ok((download_format, format))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue