Ignore errors when marking torrent as repaired (also mute warnings when under repair)

This commit is contained in:
Ben Sarmiento
2024-05-24 18:00:46 +02:00
parent 6d07645361
commit 7695412b22
4 changed files with 9 additions and 18 deletions

View File

@@ -262,9 +262,7 @@ func (t *TorrentManager) convertToTorrent(info *realdebrid.TorrentInfo) *Torrent
}
}
torrent.UnassignedLinks = mapset.NewSet[string]()
if err := torrent.State.Event(context.Background(), "mark_as_repaired"); err != nil {
t.log.Errorf("Cannot repair torrent %s: %v", torrent.Hash, err)
}
torrent.State.Event(context.Background(), "mark_as_repaired")
} else {
torrent.UnassignedLinks = mapset.NewSet[string]()
for _, link := range info.Links {
@@ -361,9 +359,7 @@ func (t *TorrentManager) mergeTorrents(existing, toMerge *Torrent) *Torrent {
})
if brokenCount == 0 && okCount > 0 {
if err := mergedTorrent.State.Event(context.Background(), "mark_as_repaired"); err != nil {
t.log.Errorf("Cannot repair torrent %s: %v", t, t.GetKey(mergedTorrent), err)
}
mergedTorrent.State.Event(context.Background(), "mark_as_repaired")
}
return mergedTorrent