delete functionality
This commit is contained in:
@@ -548,6 +548,17 @@ func (t *TorrentManager) repairAll() {
|
||||
})
|
||||
}
|
||||
|
||||
func (t *TorrentManager) Delete(accessKey string) {
|
||||
t.log.Infof("Deleting torrent %s", accessKey)
|
||||
allTorrents, _ := t.DirectoryMap.Get(ALL_TORRENTS)
|
||||
if torrent, ok := allTorrents.Get(accessKey); ok {
|
||||
for _, instance := range torrent.Instances {
|
||||
t.api.DeleteTorrent(instance.ID)
|
||||
}
|
||||
allTorrents.Remove(accessKey)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TorrentManager) Repair(accessKey string) {
|
||||
if !t.cfg.EnableRepair() {
|
||||
t.log.Warn("Repair is disabled; if you do not have other zurg instances running, you should enable repair")
|
||||
|
||||
Reference in New Issue
Block a user