mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Add --threads (-t) option to downloading commands (#256)
* Add `single-threaded` option to downloading commands * Replace `--single-threaded` boolean option with `--threads` optional `usize` option * Simplify `threads` field unwrapping * Make `--threads` `usize` with a default value
This commit is contained in:
parent
13335c020b
commit
bbb5a78765
3 changed files with 166 additions and 149 deletions
|
|
@ -98,6 +98,10 @@ pub struct Archive {
|
|||
#[arg(short, long, default_value_t = false)]
|
||||
pub(crate) yes: bool,
|
||||
|
||||
#[arg(help = "The number of threads used to download")]
|
||||
#[arg(short, long, default_value_t = num_cpus::get())]
|
||||
pub(crate) threads: usize,
|
||||
|
||||
#[arg(help = "Crunchyroll series url(s)")]
|
||||
#[arg(required = true)]
|
||||
pub(crate) urls: Vec<String>,
|
||||
|
|
@ -158,7 +162,8 @@ impl Execute for Archive {
|
|||
.ffmpeg_preset(self.ffmpeg_preset.clone().unwrap_or_default())
|
||||
.output_format(Some("matroska".to_string()))
|
||||
.audio_sort(Some(self.audio.clone()))
|
||||
.subtitle_sort(Some(self.subtitle.clone()));
|
||||
.subtitle_sort(Some(self.subtitle.clone()))
|
||||
.threads(self.threads);
|
||||
|
||||
for single_formats in single_format_collection.into_iter() {
|
||||
let (download_formats, mut format) = get_format(&self, &single_formats).await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue