From bb5bad15769339132493728e7383d1b659af9c99 Mon Sep 17 00:00:00 2001 From: Ben Sarmiento Date: Tue, 16 Jan 2024 01:09:44 +0100 Subject: [PATCH] Fix logic on id ref --- internal/torrent/refresh.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/torrent/refresh.go b/internal/torrent/refresh.go index 151ee35..867c873 100644 --- a/internal/torrent/refresh.go +++ b/internal/torrent/refresh.go @@ -44,8 +44,9 @@ func (t *TorrentManager) RefreshTorrents() []string { noInfoCount++ continue } - torrentID := info.DownloadedIDs.ToSlice()[0] - if !info.AnyInProgress() && t.forRepairs.Contains(torrentID) { + torrentIDs := info.DownloadedIDs.ToSlice() + if !info.AnyInProgress() && len(torrentIDs) > 0 && t.forRepairs.Contains(info.DownloadedIDs.ToSlice()[0]) { + torrentID := info.DownloadedIDs.ToSlice()[0] // if it's 100% and it's a temp repair, remove it t.Api.DeleteTorrent(torrentID) toReinsert.Add(t.GetKey(info))