Disabled third party image download

This commit is contained in:
Eduard Urbach 2019-10-07 13:47:51 +09:00
parent e57cc0fbeb
commit 7135733c29
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -1,12 +1,9 @@
package arn package arn
import ( import (
"net/http"
"strings" "strings"
"github.com/aerogo/http/client"
"github.com/aerogo/nano" "github.com/aerogo/nano"
"github.com/akyoto/color"
"github.com/animenotifier/kitsu" "github.com/animenotifier/kitsu"
) )
@ -47,17 +44,17 @@ func NewAnimeFromKitsuAnime(kitsuAnime *kitsu.Anime) (*Anime, *AnimeCharacters,
} }
// Download image // Download image
response, err := client.Get(attr.PosterImage.Original).End() // response, err := client.Get(attr.PosterImage.Original).End()
if err == nil && response.StatusCode() == http.StatusOK { // if err == nil && response.StatusCode() == http.StatusOK {
err := anime.SetImageBytes(response.Bytes()) // err := anime.SetImageBytes(response.Bytes())
if err != nil { // if err != nil {
color.Red("Couldn't set image for [%s] %s (%s)", anime.ID, anime, err.Error()) // color.Red("Couldn't set image for [%s] %s (%s)", anime.ID, anime, err.Error())
} // }
} else { // } else {
color.Red("No image for [%s] %s (%d)", anime.ID, anime, response.StatusCode()) // color.Red("No image for [%s] %s (%d)", anime.ID, anime, response.StatusCode())
} // }
// Rating // Rating
if anime.Rating.IsNotRated() { if anime.Rating.IsNotRated() {