saveTorrentChangesToDisk when relevant

This commit is contained in:
Ben Sarmiento
2024-01-27 16:32:50 +01:00
parent 582af81ea8
commit b44f2a4b63
6 changed files with 33 additions and 38 deletions

View File

@@ -234,7 +234,7 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
torrent.BrokenLinks = mapset.NewSet[string]()
infoCache.Set(rdTorrent.ID, &torrent)
t.writeTorrentToFile(rdTorrent.ID, &torrent)
t.saveTorrentChangesToDisk(&torrent, nil)
return &torrent
}
@@ -290,18 +290,6 @@ func (t *TorrentManager) mergeToMain(existing, toMerge *Torrent) Torrent {
}
})
// broken links
if mainTorrent.BrokenLinks.Cardinality() > 0 {
mainTorrent.SelectedFiles.IterCb(func(_ string, file *File) {
mainTorrent.BrokenLinks.Each(func(brokenLink string) bool {
if file.Link == brokenLink {
file.Link = ""
}
return file.Link == brokenLink
})
})
}
if existing.Added < toMerge.Added {
mainTorrent.Added = toMerge.Added
} else {