From d19603176255e02742656ddd4569fc566a2c1c35 Mon Sep 17 00:00:00 2001 From: TJ Horner Date: Wed, 13 Mar 2019 13:21:50 -0700 Subject: [PATCH] colors --- concurrent/download.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/concurrent/download.go b/concurrent/download.go index 26cfa50..22701dc 100644 --- a/concurrent/download.go +++ b/concurrent/download.go @@ -9,6 +9,7 @@ import ( "time" "github.com/dustin/go-humanize" + "github.com/logrusorgru/aurora" "github.com/tjhorner/e6dl/e621" ) @@ -56,15 +57,17 @@ func work(wn int, posts []e621.Post, directory string, completed *int, successes for _, post := range posts { *completed++ - fmt.Printf( - "[%d/%d] [w%d] Downloading post %d (%s) -> %s...\n", - *completed, - *total, - wn, + progress := aurora.Sprintf(aurora.Green("[%d/%d]"), *completed, *total) + workerText := aurora.Sprintf(aurora.Cyan("[w%d]"), wn) + + fmt.Println(aurora.Sprintf( + "%s %s Downloading post %d (%s) -> %s...", + progress, + workerText, post.ID, humanize.Bytes(uint64(post.FileSize)), getSavePath(&post, &directory), - ) + )) err := downloadPost(&post, directory) if err != nil {