Fix chaos causing logic and do a deep copy of file first
This commit is contained in:
@@ -572,11 +572,17 @@ func (t *TorrentManager) Repair(accessKey string) {
|
||||
var selectedFiles []*File
|
||||
var links []string
|
||||
torrent.SelectedFiles.IterCb(func(_ string, file *File) {
|
||||
selectedFiles = append(selectedFiles, file)
|
||||
if file.Link != "" {
|
||||
links = append(links, file.Link)
|
||||
fileCopy := &File{
|
||||
File: file.File,
|
||||
Added: file.Added,
|
||||
Link: file.Link,
|
||||
ZurgFS: file.ZurgFS,
|
||||
}
|
||||
file.Link = "" // empty the links = chaos!
|
||||
selectedFiles = append(selectedFiles, fileCopy)
|
||||
if fileCopy.Link != "" {
|
||||
links = append(links, fileCopy.Link)
|
||||
}
|
||||
fileCopy.Link = "" // empty the links = chaos!
|
||||
})
|
||||
selectedFiles, _ = t.organizeChaos(links, selectedFiles)
|
||||
for _, newFile := range selectedFiles {
|
||||
|
||||
Reference in New Issue
Block a user