summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@inventati.org>2020-03-15 12:58:25 +0530
committerAndinus <andinus@inventati.org>2020-03-15 12:58:25 +0530
commitf69c52811c6aeb5fbbaf155e87baf4539601d8a7 (patch)
tree31fa386868608eef6f4395c1b5cbf339c50e7926
parenta5ff830a5b2338581e9326bed68d1c219d8c6157 (diff)
downloadcetus-f69c52811c6aeb5fbbaf155e87baf4539601d8a7.tar.gz
Fix url when media type is not an image
-rw-r--r--cmd/cetus-nasa/cetus-nasa.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/cetus-nasa/cetus-nasa.go b/cmd/cetus-nasa/cetus-nasa.go
index d90a08b..5f018cb 100644
--- a/cmd/cetus-nasa/cetus-nasa.go
+++ b/cmd/cetus-nasa/cetus-nasa.go
@@ -119,6 +119,10 @@ func printDetails(apodRes nasa.APOD) {
 	fmt.Printf("Copyright: %s\n", apodRes.Copyright)
 	fmt.Printf("Date: %s\n\n", apodRes.Date)
 	fmt.Printf("Media Type: %s\n", apodRes.MediaType)
-	fmt.Printf("URL: %s\n\n", apodRes.HDURL)
+	if apodRes.MediaType == "image" {
+		fmt.Printf("URL: %s\n\n", apodRes.HDURL)
+	} else {
+		fmt.Printf("URL: %s\n\n", apodRes.HDURL)
+	}
 	fmt.Printf("Explanation: %s\n", apodRes.Explanation)
 }