Identify broken links properly

This commit is contained in:
Ben Sarmiento
2024-01-11 07:43:27 +01:00
parent 628e3d6345
commit cc37a92d75
6 changed files with 29 additions and 22 deletions

View File

@@ -16,16 +16,12 @@ func (t *TorrentManager) CheckDeletedStatus(torrent *Torrent) bool {
torrent.DownloadedIDs.Each(func(id string) bool {
info, _ := infoCache.Get(id)
info.SelectedFiles.IterCb(func(_ string, file *File) {
found := false
for _, unselectedID := range unselectedIDs {
if file.ID == unselectedID {
found = true
file.Link = "unselect"
break
}
}
if found {
file.Link = "unselect"
}
})
t.writeTorrentToFile(id, info, false)
return false