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))