fixed html escaped characters
This commit is contained in:
parent
469e2984bc
commit
74f7deb672
@ -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 {
|
||||
|
@ -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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user