Add accidental removal fix

This commit is contained in:
Ben Adrian Sarmiento
2024-07-19 04:42:09 +02:00
parent eaabd20a83
commit d2c1e12e2c
6 changed files with 17 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
package torrent
import (
"github.com/debridmediamanager/zurg/internal/config"
cmap "github.com/orcaman/concurrent-map/v2"
)
@@ -32,8 +33,12 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
}
// t.log.Infof("Removing torrent %s from zurg database (not real-debrid)", accessKey)
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) {
if directory == config.DOWNLOADS || directory == config.DUMPED_TORRENTS {
return
}
torrents.Remove(accessKey)
})
allTorrents.Remove(accessKey)
}