mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Remove deprecated archive --locale flag
This commit is contained in:
parent
84c70f2bee
commit
700b041f9a
1 changed files with 1 additions and 13 deletions
|
|
@ -15,7 +15,7 @@ use anyhow::Result;
|
||||||
use chrono::Duration;
|
use chrono::Duration;
|
||||||
use crunchyroll_rs::media::{Resolution, Subtitle};
|
use crunchyroll_rs::media::{Resolution, Subtitle};
|
||||||
use crunchyroll_rs::Locale;
|
use crunchyroll_rs::Locale;
|
||||||
use log::{debug, warn};
|
use log::debug;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
|
@ -29,9 +29,6 @@ pub struct Archive {
|
||||||
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![Locale::ja_JP, crate::utils::locale::system_locale()])]
|
#[arg(short, long, default_values_t = vec![Locale::ja_JP, crate::utils::locale::system_locale()])]
|
||||||
pub(crate) audio: Vec<Locale>,
|
pub(crate) audio: Vec<Locale>,
|
||||||
#[arg(help = "Deprecated. Use '-a' / '--audio' instead")]
|
|
||||||
#[arg(short, long)]
|
|
||||||
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. \
|
||||||
|
|
@ -122,15 +119,6 @@ impl Execute for Archive {
|
||||||
bail!("File extension is not '.mkv'. Currently only matroska / '.mkv' files are supported")
|
bail!("File extension is not '.mkv'. Currently only matroska / '.mkv' files are supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !self.locale.is_empty() {
|
|
||||||
warn!("The '-l' / '--locale' flag is deprecated, use '-a' / '--audio' instead");
|
|
||||||
for locale in &self.locale {
|
|
||||||
if !self.audio.contains(locale) {
|
|
||||||
self.audio.push(locale.clone())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self.audio = all_locale_in_locales(self.audio.clone());
|
self.audio = all_locale_in_locales(self.audio.clone());
|
||||||
self.subtitle = all_locale_in_locales(self.subtitle.clone());
|
self.subtitle = all_locale_in_locales(self.subtitle.clone());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue