mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 20:22:01 -06:00
parent
17233f2fd2
commit
685ac85857
3 changed files with 45 additions and 23 deletions
|
|
@ -122,6 +122,10 @@ pub struct Archive {
|
|||
#[arg(long)]
|
||||
no_subtitle_optimizations: bool,
|
||||
|
||||
#[arg(help = "Skip files which are already existing")]
|
||||
#[arg(long, default_value_t = false)]
|
||||
skip_existing: bool,
|
||||
|
||||
#[arg(help = "Ignore interactive input")]
|
||||
#[arg(short, long, default_value_t = false)]
|
||||
yes: bool,
|
||||
|
|
@ -242,17 +246,24 @@ impl Execute for Archive {
|
|||
for (formats, mut subtitles) in archive_formats {
|
||||
let (primary, additionally) = formats.split_first().unwrap();
|
||||
|
||||
let path = free_file(
|
||||
primary.format_path(
|
||||
if self.output.is_empty() {
|
||||
"{title}.mkv"
|
||||
} else {
|
||||
&self.output
|
||||
}
|
||||
.into(),
|
||||
true,
|
||||
),
|
||||
let formatted_path = primary.format_path(
|
||||
if self.output.is_empty() {
|
||||
"{title}.mkv"
|
||||
} else {
|
||||
&self.output
|
||||
}
|
||||
.into(),
|
||||
true,
|
||||
);
|
||||
let (path, changed) = free_file(formatted_path.clone());
|
||||
|
||||
if changed && self.skip_existing {
|
||||
debug!(
|
||||
"Skipping already existing file '{}'",
|
||||
formatted_path.to_string_lossy()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
info!(
|
||||
"Downloading {} to '{}'",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue