trakt: strip non alphanumeric characters from imdb id

This commit is contained in:
James Bayliss
2021-02-15 19:17:32 +00:00
parent 95cf1fe961
commit aadc5ece4f
4 changed files with 42 additions and 12 deletions

View File

@@ -51,7 +51,10 @@ func (c *Client) GetShow(tvdbId string) (*Show, error) {
}
// translate response
return &(*b)[0].Show, nil
show := &(*b)[0].Show
show.Ids.Imdb = util.StripNonAlphaNumeric(show.Ids.Imdb)
return show, nil
}
func (c *Client) GetMovie(imdbId string) (*Movie, error) {
@@ -92,5 +95,8 @@ func (c *Client) GetMovie(imdbId string) (*Movie, error) {
}
// translate response
return &(*b)[0].Movie, nil
movie := &(*b)[0].Movie
movie.Ids.Imdb = util.StripNonAlphaNumeric(movie.Ids.Imdb)
return movie, nil
}