mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
add tv detail page
This commit is contained in:
@@ -56,6 +56,7 @@ func (s *Server) Serve() error {
|
||||
tv.GET("/search", HttpHandler(s.SearchTvSeries))
|
||||
tv.POST("/watchlist", HttpHandler(s.AddWatchlist))
|
||||
tv.GET("/watchlist", HttpHandler(s.GetWatchlist))
|
||||
tv.GET("/series/:id", HttpHandler(s.GetTvDetails))
|
||||
}
|
||||
indexer := api.Group("/indexer")
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ package server
|
||||
import (
|
||||
"polaris/ent"
|
||||
"polaris/log"
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pkg/errors"
|
||||
@@ -81,5 +82,11 @@ func (s *Server) GetWatchlist(c *gin.Context) (interface{}, error) {
|
||||
|
||||
|
||||
func (s *Server) GetTvDetails(c *gin.Context) (interface{}, error) {
|
||||
return nil, nil
|
||||
ids := c.Param("id")
|
||||
id, err := strconv.Atoi(ids)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "convert")
|
||||
}
|
||||
detail := s.db.GetSeriesDetails(id)
|
||||
return detail, nil
|
||||
}
|
||||
Reference in New Issue
Block a user