Normalize all .jpeg to .jpg

This commit is contained in:
Eduard Urbach 2017-11-19 13:03:12 +01:00
parent 4afbd202c3
commit 5a27ebf184
2 changed files with 7 additions and 2 deletions

View File

@ -52,18 +52,23 @@ func sync(data *kitsu.Anime) *arn.Anime {
anime.Title.English = attr.Titles.En
anime.Title.Romaji = attr.Titles.EnJp
anime.Title.Synonyms = attr.AbbreviatedTitles
anime.ImageExtension = filepath.Ext(kitsu.FixImageURL(attr.PosterImage.Original))
anime.StartDate = attr.StartDate
anime.EndDate = attr.EndDate
anime.EpisodeCount = attr.EpisodeCount
anime.EpisodeLength = attr.EpisodeLength
anime.Status = attr.Status
anime.ImageExtension = filepath.Ext(kitsu.FixImageURL(attr.PosterImage.Original))
// Status "unreleased" means the same as "upcoming" so we should normalize it
if anime.Status == "unreleased" {
anime.Status = "upcoming"
}
// Normalize image extension to .jpg if .jpeg is used
if anime.ImageExtension == ".jpeg" {
anime.ImageExtension = ".jpg"
}
anime.Summary = arn.FixAnimeDescription(attr.Synopsis)
if anime.Mappings == nil {

View File

@ -26,7 +26,7 @@ func main() {
}
if _, err := os.Stat(base + ".jpeg"); err == nil {
anime.ImageExtension = ".jpeg"
anime.ImageExtension = ".jpg"
anime.Save()
continue
}