feat: change single episode monitoring status

This commit is contained in:
Simon Ding
2024-08-03 10:46:52 +08:00
parent 578b6a9d78
commit 16216fcc4f
8 changed files with 81 additions and 23 deletions

View File

@@ -193,3 +193,17 @@ func (s *Server) DeleteDownloadCLient(c *gin.Context) (interface{}, error) {
s.db.DeleteDownloadCLient(id)
return "success", nil
}
type episodeMonitoringIn struct {
EpisodeID int `json:"episode_id"`
Monitor bool `json:"monitor"`
}
func (s *Server) ChangeEpisodeMonitoring(c *gin.Context) (interface{}, error) {
var in episodeMonitoringIn
if err := c.ShouldBindJSON(&in); err != nil {
return nil, errors.Wrap(err, "bind")
}
s.db.SetEpisodeMonitoring(in.EpisodeID, in.Monitor)
return "success", nil
}