Feature: MAL URL

This commit is contained in:
daru
2022-05-16 23:40:57 +02:00
parent e8631de34f
commit 83ff446836
2 changed files with 3 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ type Anime struct {
ImageMediumURL string `json:"imageMedium"`
ImageLargeURL string `json:"imageLarge"`
ImageThumbURL string `json:"imageThumb"`
URL string `json:"url"`
Type string `json:"type"`
Status string `json:"status"`
Episodes int `json:"episodes"`

View File

@@ -46,6 +46,7 @@ func JikanConvert(jik *SeasonAnimeJikan) Anime {
Name: s.Name,
})
}
res.URL = fmt.Sprintf("https://myanimelist.net/anime/%d", res.Anime)
return res
}
@@ -87,6 +88,7 @@ func MalConvert(mal *AnimeDetailMal) Anime {
}
res.StartDate, _ = time.Parse("2006-01-02", mal.StartDate)
res.EndDate, _ = time.Parse("2006-01-02", mal.EndDate)
res.URL = fmt.Sprintf("https://myanimelist.net/anime/%d", res.Anime)
return res
}