Fix logic on id ref

This commit is contained in:
Ben Sarmiento
2024-01-16 01:09:44 +01:00
parent 1718b9dfbf
commit bb5bad1576

View File

@@ -44,8 +44,9 @@ func (t *TorrentManager) RefreshTorrents() []string {
noInfoCount++ noInfoCount++
continue continue
} }
torrentIDs := info.DownloadedIDs.ToSlice()
if !info.AnyInProgress() && len(torrentIDs) > 0 && t.forRepairs.Contains(info.DownloadedIDs.ToSlice()[0]) {
torrentID := info.DownloadedIDs.ToSlice()[0] torrentID := info.DownloadedIDs.ToSlice()[0]
if !info.AnyInProgress() && t.forRepairs.Contains(torrentID) {
// if it's 100% and it's a temp repair, remove it // if it's 100% and it's a temp repair, remove it
t.Api.DeleteTorrent(torrentID) t.Api.DeleteTorrent(torrentID)
toReinsert.Add(t.GetKey(info)) toReinsert.Add(t.GetKey(info))