Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Remove deprecated archive --locale flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bytedream committed Jul 27, 2023
1 parent 84c70f2 commit 700b041
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions crunchy-cli-core/src/archive/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use anyhow::Result;
use chrono::Duration;
use crunchyroll_rs::media::{Resolution, Subtitle};
use crunchyroll_rs::Locale;
use log::{debug, warn};
use log::debug;
use std::collections::HashMap;
use std::path::PathBuf;

Expand All @@ -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 ")))]
#[arg(short, long, default_values_t = vec![Locale::ja_JP, crate::utils::locale::system_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. \
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. \
Expand Down Expand Up @@ -122,15 +119,6 @@ impl Execute for Archive {
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.subtitle = all_locale_in_locales(self.subtitle.clone());

Expand Down

0 comments on commit 700b041

Please sign in to comment.