Remove components, do downloaded ids ; support dumps
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package torrent
|
||||
|
||||
import (
|
||||
"github.com/debridmediamanager/zurg/pkg/realdebrid"
|
||||
cmap "github.com/orcaman/concurrent-map/v2"
|
||||
)
|
||||
|
||||
@@ -27,10 +26,12 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
|
||||
if torrent, ok := allTorrents.Get(accessKey); ok {
|
||||
hash = torrent.Hash
|
||||
if deleteInRD {
|
||||
torrent.Components.IterCb(func(torrentID string, _ *realdebrid.TorrentInfo) {
|
||||
torrent.DownloadedIDs.Each(func(torrentID string) bool {
|
||||
t.log.Debugf("Deleting torrent %s (id=%s) in RD", accessKey, torrentID)
|
||||
t.api.DeleteTorrent(torrentID)
|
||||
t.deleteInfoFile(torrentID)
|
||||
return false
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user