mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-08 11:07:42 +08:00
chore: updates
This commit is contained in:
@@ -129,7 +129,7 @@ func (s *Server) Serve() error {
|
||||
func (s *Server) TMDB() (*tmdb.Client, error) {
|
||||
api := s.db.GetSetting(db.SettingTmdbApiKey)
|
||||
if api == "" {
|
||||
return nil, errors.New("tmdb api not set")
|
||||
return nil, errors.New("TMDB apiKey not set")
|
||||
}
|
||||
return tmdb.NewClient(api)
|
||||
}
|
||||
|
||||
@@ -43,7 +43,11 @@ func (s *Server) SearchMedia(c *gin.Context) (interface{}, error) {
|
||||
return nil, errors.Wrap(err, "bind query")
|
||||
}
|
||||
log.Infof("search media with keyword: %v", q.Query)
|
||||
r, err := s.MustTMDB().SearchMedia(q.Query, s.language, q.Page)
|
||||
tmdb, err := s.TMDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r, err := tmdb.SearchMedia(q.Query, s.language, q.Page)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "search tv")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user