diff --git a/jobs/anime-images/anime-images.go b/jobs/anime-images/anime-images.go index fb17b5ca..10d851fa 100644 --- a/jobs/anime-images/anime-images.go +++ b/jobs/anime-images/anime-images.go @@ -7,7 +7,6 @@ import ( "path" "runtime" "sort" - "strings" "time" _ "image/gif" @@ -66,10 +65,6 @@ func main() { } func work(anime *arn.Anime) error { - if !strings.HasPrefix(anime.Image.Original, "//media.kitsu.io/anime/") { - return nil - } - <-ticker.C originals := path.Join(os.Getenv("GOPATH"), "/src/github.com/animenotifier/notify.moe/images/anime/original/") @@ -84,6 +79,8 @@ func work(anime *arn.Anime) error { webpQuality := 70 jpegQuality := 70 + kitsuOriginal := fmt.Sprintf("https://media.kitsu.io/anime/poster_images/%s/original", anime.ID) + system := ipo.System{ Inputs: []ipo.Input{ &inputs.FileSystemImage{ @@ -99,7 +96,7 @@ func work(anime *arn.Anime) error { URL: path.Join(originals, anime.ID+".gif"), }, &inputs.NetworkImage{ - URL: anime.Image.Original, + URL: kitsuOriginal + anime.ImageExtension, }, }, Outputs: []ipo.Output{ diff --git a/jobs/sync-anime/sync-anime.go b/jobs/sync-anime/sync-anime.go index b5e5bd6b..9a412cb5 100644 --- a/jobs/sync-anime/sync-anime.go +++ b/jobs/sync-anime/sync-anime.go @@ -38,7 +38,6 @@ func sync(data *kitsu.Anime) *arn.Anime { if strings.Contains(err.Error(), "not found") { anime = &arn.Anime{ Title: &arn.AnimeTitle{}, - Image: &arn.AnimeImageTypes{}, } } else { panic(err) @@ -84,7 +83,7 @@ func sync(data *kitsu.Anime) *arn.Anime { anime.AddMapping("myanimelist/anime", mapping.Attributes.ExternalID, "") case "anidb": anime.AddMapping("anidb/anime", mapping.Attributes.ExternalID, "") - case "thetvdb/series": + case "thetvdb", "thetvdb/series": anime.AddMapping("thetvdb/anime", mapping.Attributes.ExternalID, "") case "thetvdb/season": // Ignore