feat: add series delete feature

This commit is contained in:
Simon Ding
2024-07-13 17:50:19 +08:00
parent 85f8750908
commit 670fc16abe
6 changed files with 68 additions and 13 deletions

View File

@@ -99,4 +99,16 @@ func (s *Server) GetAvailableResolutions(c *gin.Context) (interface{}, error) {
db.R1080p,
db.R4k,
}, nil
}
func (s *Server) DeleteFromWatchlist(c *gin.Context) (interface{}, error) {
ids := c.Param("id")
id, err := strconv.Atoi(ids)
if err != nil {
return nil, errors.Wrap(err, "convert")
}
if err := s.db.DeleteSeries(id); err != nil {
return nil, errors.Wrap(err, "delete db")
}
return "success", nil
}