diff --git a/imdb-scraper_test.go b/imdb-scraper_test.go index 4c16046..fa4486c 100644 --- a/imdb-scraper_test.go +++ b/imdb-scraper_test.go @@ -217,6 +217,15 @@ func TestScrap(t *testing.T) { Type: "Series", Year: 2019, }, + "tt0366551": { + AlternateName: "Harold & Kumar", + IMDbID: "tt0366551", + Rating: 7.0, + RuntimeInMins: 88, + Title: "Harold & Kumar Go to White Castle", + Type: "Movie", + Year: 2004, + }, } for d, expectedResult := range data { diff --git a/models.go b/models.go index e56c8d6..e884ceb 100644 --- a/models.go +++ b/models.go @@ -1,6 +1,7 @@ package imdbs import ( + "html" "strings" "time" ) @@ -96,10 +97,10 @@ func (s IMDbJSON) TransformIntoIMDbEntry(id string, year int64) IMDbEntry { entry := IMDbEntry{ IMDbID: id, - AlternateName: s.AlternateName, + AlternateName: html.UnescapeString(s.AlternateName), Rating: s.AggregateRating.RatingValue, RuntimeInMins: 0, - Title: s.Name, + Title: html.UnescapeString(s.Name), Type: strings.Replace(s.Type, "TVSeries", "Series", -1), Year: year, }