Log updates

This commit is contained in:
Ben Sarmiento
2024-05-27 15:54:28 +02:00
parent 4ec1c4496d
commit f28255a142
3 changed files with 17 additions and 22 deletions

View File

@@ -22,9 +22,7 @@ func (t *TorrentManager) CheckDeletedStatus(torrent *Torrent) bool {
func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
var hash string
if torrent, ok := allTorrents.Get(accessKey); ok {
hash = torrent.Hash
if deleteInRD {
torrent.DownloadedIDs.Each(func(torrentID string) bool {
t.log.Debugf("Deleting torrent %s (id=%s) in RD", accessKey, torrentID)
@@ -40,7 +38,4 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
torrents.Remove(accessKey)
})
allTorrents.Remove(accessKey)
if hash != "" {
t.deleteTorrentFile(hash)
}
}