From 577c0679adee027dc52801a8745968a830d35120 Mon Sep 17 00:00:00 2001 From: ByteDream Date: Sun, 15 Jan 2023 21:43:31 +0100 Subject: [PATCH] Remove automatically set filename if output is empty --- crunchy-cli-core/src/cli/archive.rs | 10 +--------- crunchy-cli-core/src/cli/download.rs | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/crunchy-cli-core/src/cli/archive.rs b/crunchy-cli-core/src/cli/archive.rs index a8b79b6..31d39c6 100644 --- a/crunchy-cli-core/src/cli/archive.rs +++ b/crunchy-cli-core/src/cli/archive.rs @@ -246,15 +246,7 @@ impl Execute for Archive { for (formats, mut subtitles) in archive_formats { let (primary, additionally) = formats.split_first().unwrap(); - let formatted_path = primary.format_path( - if self.output.is_empty() { - "{title}.mkv" - } else { - &self.output - } - .into(), - true, - ); + let formatted_path = primary.format_path((&self.output).into(), true); let (path, changed) = free_file(formatted_path.clone()); if changed && self.skip_existing { diff --git a/crunchy-cli-core/src/cli/download.rs b/crunchy-cli-core/src/cli/download.rs index fddbfd3..d8fb003 100644 --- a/crunchy-cli-core/src/cli/download.rs +++ b/crunchy-cli-core/src/cli/download.rs @@ -213,15 +213,7 @@ impl Execute for Download { } for format in formats { - let formatted_path = format.format_path( - if self.output.is_empty() { - "{title}.mkv" - } else { - &self.output - } - .into(), - true, - ); + let formatted_path = format.format_path((&self.output).into(), true); let (path, changed) = free_file(formatted_path.clone()); if changed && self.skip_existing {