Skip to content

Commit

Permalink
fix: change en name
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Jul 12, 2024
1 parent c12839d commit 7597e6a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions server/watchlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,8 @@ func (s *Server) AddWatchlist(c *gin.Context) (interface{}, error) {
return nil, errors.Wrap(err, "get tv detail")
}
log.Infof("find detail for tv id %d: %v", in.TmdbID, detail)
var nameEn = detail.OriginalName
alterTitles, err := s.MustTMDB().GetTVAlternativeTitles(in.TmdbID, s.language)
if err == nil {
for _, r := range alterTitles.Results {
if r.Iso3166_1 == "US" {
log.Infof("found en name: %s", r.Title)
nameEn = r.Title
}
}
}
detailEn, _ := s.MustTMDB().GetTvDetails(in.TmdbID, "en-US")
var nameEn = detailEn.Name

var epIds []int
for _, season := range detail.Seasons {
Expand Down

0 comments on commit 7597e6a

Please sign in to comment.