Adjust file reads and writes
This commit is contained in:
@@ -544,27 +544,3 @@ func (t *TorrentManager) isStillBroken(info *realdebrid.TorrentInfo, brokenFiles
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func getSelectedFiles(info *realdebrid.TorrentInfo) []*File {
|
||||
var selectedFiles []*File
|
||||
// if some Links are empty, we need to repair it
|
||||
for _, file := range info.Files {
|
||||
if file.Selected == 0 {
|
||||
continue
|
||||
}
|
||||
selectedFiles = append(selectedFiles, &File{
|
||||
File: file,
|
||||
Ended: info.Ended,
|
||||
Link: "", // no link yet
|
||||
IsBroken: true,
|
||||
})
|
||||
}
|
||||
if len(selectedFiles) == len(info.Links) {
|
||||
// all links are still intact! good!
|
||||
for i, file := range selectedFiles {
|
||||
file.Link = info.Links[i]
|
||||
file.IsBroken = false
|
||||
}
|
||||
}
|
||||
return selectedFiles
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user