mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
Merge branch 'master' into 230-torrents-category
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user