diff options
author | Andinus <andinus@inventati.org> | 2020-03-15 12:58:25 +0530 |
---|---|---|
committer | Andinus <andinus@inventati.org> | 2020-03-15 12:58:25 +0530 |
commit | f69c52811c6aeb5fbbaf155e87baf4539601d8a7 (patch) | |
tree | 31fa386868608eef6f4395c1b5cbf339c50e7926 /cmd | |
parent | a5ff830a5b2338581e9326bed68d1c219d8c6157 (diff) | |
download | cetus-f69c52811c6aeb5fbbaf155e87baf4539601d8a7.tar.gz |
Fix url when media type is not an image
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cetus-nasa/cetus-nasa.go | 6 |
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) } |