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

@@ -12,9 +12,7 @@ func (t *TorrentManager) CheckDeletedStatus(torrent *Torrent) bool {
if len(unselectedIDs) == torrent.SelectedFiles.Count() && len(unselectedIDs) > 0 {
return true
} else if len(unselectedIDs) > 0 {
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
torrent.DownloadedIDs.Each(func(id string) bool {
info, _ := infoCache.Get(id)
t.saveTorrentChangesToDisk(torrent, func(info *Torrent) {
info.SelectedFiles.IterCb(func(_ string, file *File) {
for _, unselectedID := range unselectedIDs {
if file.ID == unselectedID {
@@ -23,8 +21,6 @@ func (t *TorrentManager) CheckDeletedStatus(torrent *Torrent) bool {
}
}
})
t.writeTorrentToFile(id, info)
return false
})
}
return false