Remove immediate bin

This commit is contained in:
Ben Adrian Sarmiento
2024-06-18 23:43:31 +02:00
parent 34a7d6a432
commit acc9b69b5a
8 changed files with 58 additions and 87 deletions

View File

@@ -25,9 +25,7 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
if torrent, ok := allTorrents.Get(accessKey); ok {
if deleteInRD {
torrent.DownloadedIDs.Clone().Each(func(torrentID string) bool {
t.log.Debugf("Deleting torrent %s (id=%s) in RD", accessKey, torrentID)
t.api.DeleteTorrent(torrentID)
t.deleteInfoFile(torrentID)
t.DeleteByID(torrentID)
return false
})
}
@@ -38,3 +36,8 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
})
allTorrents.Remove(accessKey)
}
func (t *TorrentManager) DeleteByID(torrentID string) {
t.api.DeleteTorrent(torrentID)
t.deleteInfoFile(torrentID)
}