mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
Move wipe to server side. Add UI unsafe buttons (#355)
* move 'remove all' function to server side ('wipe')
* add UnsafeButton to RemoveAll and CloseServer webui
This commit is contained in:
committed by
GitHub
parent
d1b29bd848
commit
5e71af9751
@@ -72,6 +72,10 @@ func torrents(c *gin.Context) {
|
||||
{
|
||||
dropTorrent(req, c)
|
||||
}
|
||||
case "wipe":
|
||||
{
|
||||
wipeTorrents(req, c)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,3 +188,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