Merge branch 'master' into 230-torrents-category

This commit is contained in:
cocool97
2024-03-24 14:28:31 +01:00
committed by GitHub
64 changed files with 1437 additions and 508 deletions

View File

@@ -73,6 +73,10 @@ func torrents(c *gin.Context) {
{
dropTorrent(req, c)
}
case "wipe":
{
wipeTorrents(req, c)
}
}
}
@@ -188,3 +192,16 @@ func dropTorrent(req torrReqJS, c *gin.Context) {
torr.DropTorrent(req.Hash)
c.Status(200)
}
func wipeTorrents(req torrReqJS, c *gin.Context) {
torrents := torr.ListTorrent()
for _, t := range torrents {
torr.RemTorrent(t.TorrentSpec.InfoHash.HexString())
}
// TODO: remove (copied todo from remTorrent())
if set.BTsets.EnableDLNA {
dlna.Stop()
dlna.Start()
}
c.Status(200)
}