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
import (
"net/http"
"strings"
"github.com/aerogo/http/client"
"github.com/aerogo/nano"
"github.com/akyoto/color"
"github.com/animenotifier/kitsu"
)
@ -47,17 +44,17 @@ func NewAnimeFromKitsuAnime(kitsuAnime *kitsu.Anime) (*Anime, *AnimeCharacters,
}
// 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 {
err := anime.SetImageBytes(response.Bytes())
// if err == nil && response.StatusCode() == http.StatusOK {
// err := anime.SetImageBytes(response.Bytes())
if err != nil {
color.Red("Couldn't set image for [%s] %s (%s)", anime.ID, anime, err.Error())
}
} else {
color.Red("No image for [%s] %s (%d)", anime.ID, anime, response.StatusCode())
}
// if err != nil {
// color.Red("Couldn't set image for [%s] %s (%s)", anime.ID, anime, err.Error())
// }
// } else {
// color.Red("No image for [%s] %s (%d)", anime.ID, anime, response.StatusCode())
// }
// Rating
if anime.Rating.IsNotRated() {