Remove annoying logs

This commit is contained in:
Ben Sarmiento
2024-01-28 18:27:39 +01:00
parent 00e4f8013c
commit 0678af2bc2
6 changed files with 57 additions and 28 deletions

View File

@@ -179,10 +179,13 @@ func (t *TorrentManager) repair(torrent *Torrent) {
t.log.Infof("repair_method#1: Torrent %s is still in progress but it should work once done (torrent is temporarily hidden until download has completed)", t.GetKey(torrent))
return
} else if info != nil && info.IsDone() && !t.isStillBroken(info, brokenFiles) {
ix := 0
torrent.SelectedFiles.IterCb(func(_ string, file *File) {
file.Link = info.Links[ix]
ix++
torrent.SelectedFiles.IterCb(func(_ string, oldFile *File) {
for ix, newFile := range info.Files {
if oldFile.ID == newFile.ID {
oldFile.Link = info.Links[ix]
break
}
}
})
t.saveTorrentChangesToDisk(torrent, nil)
t.log.Infof("Successfully repaired torrent %s using repair_method#1", t.GetKey(torrent))
@@ -521,12 +524,10 @@ func (t *TorrentManager) handleFixers(fixer realdebrid.Torrent) *Torrent {
if info.IsDone() {
if !t.isStillBroken(info, brokenFiles) {
ix := 0
torrent.SelectedFiles.IterCb(func(_ string, file *File) {
for _, brokenFile := range brokenFiles {
if file.ID == brokenFile.ID {
file.Link = info.Links[ix]
ix++
torrent.SelectedFiles.IterCb(func(_ string, oldFile *File) {
for ix, newFile := range info.Files {
if oldFile.ID == newFile.ID {
oldFile.Link = info.Links[ix]
break
}
}