fix: add to watchlist

This commit is contained in:
Simon Ding
2024-07-12 14:36:32 +08:00
parent fc35850426
commit 55966b8115
5 changed files with 40 additions and 10 deletions

View File

@@ -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
}