mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Change archive flag name from audio to locale
This commit is contained in:
parent
502cb39923
commit
4fd98723ea
1 changed files with 4 additions and 4 deletions
|
|
@ -44,7 +44,7 @@ pub struct Archive {
|
||||||
#[arg(long_help = format!("Audio languages. Can be used multiple times. \
|
#[arg(long_help = format!("Audio languages. Can be used multiple times. \
|
||||||
Available languages are:\n{}", Locale::all().into_iter().map(|l| format!("{:<6} → {}", l.to_string(), l.to_human_readable())).collect::<Vec<String>>().join("\n ")))]
|
Available languages are:\n{}", Locale::all().into_iter().map(|l| format!("{:<6} → {}", l.to_string(), l.to_human_readable())).collect::<Vec<String>>().join("\n ")))]
|
||||||
#[arg(short, long, default_values_t = vec![crate::utils::locale::system_locale(), Locale::ja_JP])]
|
#[arg(short, long, default_values_t = vec![crate::utils::locale::system_locale(), Locale::ja_JP])]
|
||||||
audio: Vec<Locale>,
|
locale: Vec<Locale>,
|
||||||
#[arg(help = format!("Subtitle languages. Can be used multiple times. \
|
#[arg(help = format!("Subtitle languages. Can be used multiple times. \
|
||||||
Available languages are: {}", Locale::all().into_iter().map(|l| l.to_string()).collect::<Vec<String>>().join(", ")))]
|
Available languages are: {}", Locale::all().into_iter().map(|l| l.to_string()).collect::<Vec<String>>().join(", ")))]
|
||||||
#[arg(long_help = format!("Subtitle languages. Can be used multiple times. \
|
#[arg(long_help = format!("Subtitle languages. Can be used multiple times. \
|
||||||
|
|
@ -292,7 +292,7 @@ async fn formats_from_series(
|
||||||
// get all locales which are specified but not present in the current iterated season and
|
// get all locales which are specified but not present in the current iterated season and
|
||||||
// print an error saying this
|
// print an error saying this
|
||||||
let not_present_audio = archive
|
let not_present_audio = archive
|
||||||
.audio
|
.locale
|
||||||
.clone()
|
.clone()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|l| !season.iter().any(|s| &s.metadata.audio_locale == l))
|
.filter(|l| !season.iter().any(|s| &s.metadata.audio_locale == l))
|
||||||
|
|
@ -309,7 +309,7 @@ async fn formats_from_series(
|
||||||
// remove all seasons with the wrong audio for the current iterated season number
|
// remove all seasons with the wrong audio for the current iterated season number
|
||||||
seasons.retain(|s| {
|
seasons.retain(|s| {
|
||||||
s.metadata.season_number != season.first().unwrap().metadata.season_number
|
s.metadata.season_number != season.first().unwrap().metadata.season_number
|
||||||
|| archive.audio.contains(&s.metadata.audio_locale)
|
|| archive.locale.contains(&s.metadata.audio_locale)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -318,7 +318,7 @@ async fn formats_from_series(
|
||||||
BTreeMap::new();
|
BTreeMap::new();
|
||||||
for season in series.seasons().await? {
|
for season in series.seasons().await? {
|
||||||
if !url_filter.is_season_valid(season.metadata.season_number)
|
if !url_filter.is_season_valid(season.metadata.season_number)
|
||||||
|| !archive.audio.contains(&season.metadata.audio_locale)
|
|| !archive.locale.contains(&season.metadata.audio_locale)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue