Fixers
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package torrent
|
||||
|
||||
import cmap "github.com/orcaman/concurrent-map/v2"
|
||||
import (
|
||||
"github.com/debridmediamanager/zurg/pkg/realdebrid"
|
||||
cmap "github.com/orcaman/concurrent-map/v2"
|
||||
)
|
||||
|
||||
// CheckDeletedStatus checks if all files in a torrent are marked as deleted, if so, it returns true
|
||||
func (t *TorrentManager) CheckDeletedStatus(torrent *Torrent) bool {
|
||||
@@ -24,11 +27,11 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
|
||||
if torrent, ok := allTorrents.Get(accessKey); ok {
|
||||
hash = torrent.Hash
|
||||
if deleteInRD {
|
||||
for torrentID := range torrent.Components {
|
||||
torrent.Components.IterCb(func(torrentID string, _ *realdebrid.TorrentInfo) {
|
||||
t.log.Debugf("Deleting torrent %s (id=%s) in RD", accessKey, torrentID)
|
||||
t.api.DeleteTorrent(torrentID)
|
||||
t.deleteInfoFile(torrentID)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
t.log.Infof("Removing torrent %s from zurg database (not real-debrid)", accessKey)
|
||||
|
||||
Reference in New Issue
Block a user