mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-06 10:07:45 +08:00
fix: add to watchlist
This commit is contained in:
7
server/activity.go
Normal file
7
server/activity.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package server
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func (s *Server) GetRunningActivities(c *gin.Context) (interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -57,6 +57,7 @@ func (s *Server) Serve() error {
|
||||
tv.POST("/watchlist", HttpHandler(s.AddWatchlist))
|
||||
tv.GET("/watchlist", HttpHandler(s.GetWatchlist))
|
||||
tv.GET("/series/:id", HttpHandler(s.GetTvDetails))
|
||||
tv.GET("/resolutions", HttpHandler(s.GetAvailableResolutions))
|
||||
}
|
||||
indexer := api.Group("/indexer")
|
||||
{
|
||||
|
||||
@@ -28,8 +28,9 @@ func (s *Server) SearchTvSeries(c *gin.Context) (interface{}, error) {
|
||||
}
|
||||
|
||||
type addWatchlistIn struct {
|
||||
TmdbID int `json:"id" binding:"required"`
|
||||
StorageID int `json:"storage_id"`
|
||||
TmdbID int `json:"tmdb_id" binding:"required"`
|
||||
StorageID int `json:"storage_id" binding:"required"`
|
||||
Resolution db.ResolutionType `json:"resolution" binding:"required"`
|
||||
}
|
||||
|
||||
func (s *Server) AddWatchlist(c *gin.Context) (interface{}, error) {
|
||||
@@ -99,3 +100,11 @@ func (s *Server) GetTvDetails(c *gin.Context) (interface{}, error) {
|
||||
detail := s.db.GetSeriesDetails(id)
|
||||
return detail, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetAvailableResolutions(c *gin.Context) (interface{}, error) {
|
||||
return []db.ResolutionType{
|
||||
db.R720p,
|
||||
db.R1080p,
|
||||
db.R4k,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user