mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-12-18 13:36:09 +05:00
Fix '/api/v1/movies/popular' route
This commit is contained in:
@@ -77,10 +77,24 @@ func (s *TVService) GetByID(id int, language string, idType string) (*models.TVS
|
||||
}
|
||||
|
||||
func (s *TVService) GetPopular(page int, language string) (*models.TMDBTVResponse, error) {
|
||||
if ShouldUseKinopoisk(language) && s.kpService != nil {
|
||||
kpResult, err := s.kpService.GetCollection("TOP_POPULAR_ALL", page)
|
||||
if err == nil && kpResult != nil && len(kpResult.Films) > 0 {
|
||||
return MapKPSearchToTMDBTVResponse(kpResult), nil
|
||||
}
|
||||
}
|
||||
|
||||
return s.tmdb.GetPopularTVShows(page, language)
|
||||
}
|
||||
|
||||
func (s *TVService) GetTopRated(page int, language string) (*models.TMDBTVResponse, error) {
|
||||
if ShouldUseKinopoisk(language) && s.kpService != nil {
|
||||
kpResult, err := s.kpService.GetCollection("TOP_250_TV_SHOWS", page)
|
||||
if err == nil && kpResult != nil && len(kpResult.Films) > 0 {
|
||||
return MapKPSearchToTMDBTVResponse(kpResult), nil
|
||||
}
|
||||
}
|
||||
|
||||
return s.tmdb.GetTopRatedTVShows(page, language)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user