From 5e6884af6646a8fe88e40dd5ea5f15a517eaaa2a Mon Sep 17 00:00:00 2001 From: ChaoticByte Date: Sat, 8 Mar 2025 22:09:57 +0100 Subject: [PATCH] Show output filename in the cli --- VERSION | 2 +- cli/cli.go | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 359a5b9..10bf840 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 \ No newline at end of file +2.0.1 \ No newline at end of file diff --git a/cli/cli.go b/cli/cli.go index f588bd3..4670642 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -177,11 +177,16 @@ func CliRun() int { CliAvailableFormats(streamEp.Formats) return 1 } - CliShowFormat(format) + cli.InfoMessage(fmt.Sprintf("Format: %v", format.Name)) if args.ChapterIdx >= 0 { cli.InfoMessage(fmt.Sprintf("Chapter: %v. %v", cliArgs.ChapterNum, streamEp.Chapters[args.ChapterIdx].Title)) } + // We already set the output file correctly so we can output it + if args.OutputFile == "" { + args.OutputFile = streamEp.GetProposedFilename(args.ChapterIdx) + } // Start Download + cli.InfoMessage(fmt.Sprintf("Output: %v", args.OutputFile)) fmt.Print("\n") if err = streamEp.Download(args, &cli, make(chan os.Signal, 1)); err != nil { cli.ErrorMessage(err) @@ -205,10 +210,6 @@ func CliAvailableFormats(formats []core.VideoFormat) { } } -func CliShowFormat(format core.VideoFormat) { - fmt.Printf("Format: %v\n", format.Name) -} - type Cli struct{} func (cli *Cli) DownloadProgress(progress float32, rate float64, delaying bool, waiting bool, retries int, title string) {