rollback that
Cette révision appartient à :
Parent
57be73d2e6
révision
6931952a63
1 fichiers modifiés avec 7 ajouts et 1 suppressions
|
@ -121,13 +121,19 @@ func TorrentPostEditModPanel(c *gin.Context) {
|
||||||
// TorrentDeleteModPanel : Controller for deleting a torrent
|
// TorrentDeleteModPanel : Controller for deleting a torrent
|
||||||
func TorrentDeleteModPanel(c *gin.Context) {
|
func TorrentDeleteModPanel(c *gin.Context) {
|
||||||
id, _ := strconv.ParseInt(c.PostForm("id"), 10, 32)
|
id, _ := strconv.ParseInt(c.PostForm("id"), 10, 32)
|
||||||
|
definitely := c.Request.URL.Query()["definitely"]
|
||||||
|
|
||||||
var returnRoute = "/mod/torrents"
|
var returnRoute = "/mod/torrents"
|
||||||
torrent, errFind := torrents.FindByID(uint(id))
|
torrent, errFind := torrents.FindByID(uint(id))
|
||||||
if errFind == nil {
|
if errFind == nil {
|
||||||
var err error
|
var err error
|
||||||
|
if definitely != nil {
|
||||||
|
_, _, err = torrent.DefinitelyDelete()
|
||||||
|
returnRoute = "/mod/torrents/deleted"
|
||||||
|
} else {
|
||||||
_, _, err = torrent.Delete(false)
|
_, _, err = torrent.Delete(false)
|
||||||
|
}
|
||||||
|
|
||||||
//delete reports of torrent
|
//delete reports of torrent
|
||||||
query := &search.Query{}
|
query := &search.Query{}
|
||||||
query.Append("torrent_id", id)
|
query.Append("torrent_id", id)
|
||||||
|
|
Référencer dans un nouveau ticket