fixed html escaped characters
This commit is contained in:
parent
469e2984bc
commit
74f7deb672
@ -217,6 +217,15 @@ func TestScrap(t *testing.T) {
|
|||||||
Type: "Series",
|
Type: "Series",
|
||||||
Year: 2019,
|
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 {
|
for d, expectedResult := range data {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package imdbs
|
package imdbs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"html"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -96,10 +97,10 @@ func (s IMDbJSON) TransformIntoIMDbEntry(id string, year int64) IMDbEntry {
|
|||||||
|
|
||||||
entry := IMDbEntry{
|
entry := IMDbEntry{
|
||||||
IMDbID: id,
|
IMDbID: id,
|
||||||
AlternateName: s.AlternateName,
|
AlternateName: html.UnescapeString(s.AlternateName),
|
||||||
Rating: s.AggregateRating.RatingValue,
|
Rating: s.AggregateRating.RatingValue,
|
||||||
RuntimeInMins: 0,
|
RuntimeInMins: 0,
|
||||||
Title: s.Name,
|
Title: html.UnescapeString(s.Name),
|
||||||
Type: strings.Replace(s.Type, "TVSeries", "Series", -1),
|
Type: strings.Replace(s.Type, "TVSeries", "Series", -1),
|
||||||
Year: year,
|
Year: year,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user