do not overwrite info
This commit is contained in:
@@ -14,8 +14,20 @@ func (t *TorrentManager) CheckDeletedStatus(torrent *Torrent) bool {
|
||||
} else if len(unselectedIDs) > 0 {
|
||||
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
|
||||
torrent.DownloadedIDs.Each(func(id string) bool {
|
||||
infoCache.Set(id, torrent)
|
||||
t.writeTorrentToFile(id, torrent, false)
|
||||
info, _ := infoCache.Get(id)
|
||||
info.SelectedFiles.IterCb(func(_ string, file *File) {
|
||||
found := false
|
||||
for _, unselectedID := range unselectedIDs {
|
||||
if file.ID == unselectedID {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if found {
|
||||
file.Link = "unselect"
|
||||
}
|
||||
})
|
||||
t.writeTorrentToFile(id, info, false)
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user