mirror of
https://github.com/simon-ding/polaris.git
synced 2026-04-22 03:37:30 +08:00
add indexer setting
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"polaris/log"
|
||||
"polaris/pkg/torznab"
|
||||
"polaris/pkg/transmission"
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pkg/errors"
|
||||
@@ -48,6 +49,16 @@ func (s *Server) AddTorznabInfo(c *gin.Context) (interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (s *Server) DeleteTorznabInfo(c *gin.Context) (interface{}, error) {
|
||||
var ids = c.Param("id")
|
||||
id, err := strconv.Atoi(ids)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("id is not correct: %v", ids)
|
||||
}
|
||||
s.db.DeleteTorznab(id)
|
||||
return "success", nil
|
||||
}
|
||||
|
||||
func (s *Server) GetAllIndexers(c *gin.Context) (interface{}, error) {
|
||||
indexers := s.db.GetAllTorznabInfo()
|
||||
if len(indexers) == 0 {
|
||||
@@ -124,4 +135,4 @@ func (s *Server) GetAllDonloadClients(c *gin.Context) (interface{}, error) {
|
||||
return nil, fmt.Errorf("no download client")
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user