Revert to old deletion method

This commit is contained in:
Ben Sarmiento
2024-01-20 05:09:49 +01:00
parent 47dfef9e21
commit 14f6169601

View File

@@ -325,7 +325,9 @@ func (t *TorrentManager) redownloadTorrent(torrent *Torrent, brokenFiles string)
if info.Progress != 100 { if info.Progress != 100 {
t.log.Infof("Torrent %s (id=%s) is not cached anymore so we have to wait until completion (this should fix the issue already)", t.GetKey(torrent), info.ID) t.log.Infof("Torrent %s (id=%s) is not cached anymore so we have to wait until completion (this should fix the issue already)", t.GetKey(torrent), info.ID)
if len(oldTorrentIDs) > 0 { if len(oldTorrentIDs) > 0 {
t.Delete(t.GetKey(torrent), true) for _, id := range oldTorrentIDs {
t.Api.DeleteTorrent(id)
}
} else { } else {
t.fixers.Set(newTorrentID, torrent) t.fixers.Set(newTorrentID, torrent)
} }
@@ -340,7 +342,9 @@ func (t *TorrentManager) redownloadTorrent(torrent *Torrent, brokenFiles string)
if len(oldTorrentIDs) > 0 { if len(oldTorrentIDs) > 0 {
// only triggered when brokenFiles == "" // only triggered when brokenFiles == ""
t.Delete(t.GetKey(torrent), true) for _, id := range oldTorrentIDs {
t.Api.DeleteTorrent(id)
}
} else { } else {
t.fixers.Set(newTorrentID, torrent) t.fixers.Set(newTorrentID, torrent)
} }