From 0be7eca8cd95fa333e1b858eb23b51bc6e50dc87 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 8 Jul 2017 17:34:21 +0200 Subject: [PATCH] Improved avatar generator --- jobs/avatars/avatars.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jobs/avatars/avatars.go b/jobs/avatars/avatars.go index 277106e7..f7516162 100644 --- a/jobs/avatars/avatars.go +++ b/jobs/avatars/avatars.go @@ -131,11 +131,16 @@ func Work(user *arn.User) { continue } + // Name of source sourceType := reflect.TypeOf(source).Elem().Name() + // Log + fmt.Println(color.GreenString("✔"), sourceType, "|", user.Nick, "|", avatar) + // Avoid quality loss (if it's on the file system, we don't need to write it again) if sourceType == "FileSystem" { - continue + user.AvatarExtension = avatar.Extension() + break } for _, writer := range avatarOutputs { @@ -146,7 +151,6 @@ func Work(user *arn.User) { } } - fmt.Println(color.GreenString("✔"), sourceType, "|", user.Nick, "|", avatar) break }