mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-14 20:33:41 +00:00
fix(bt): remove unselected files from the correct download path
This commit is contained in:
1 parent
a83e3a2b84
commit
967ef25408
2 files changed
+112
-1
No files matched your search
@@ -399,7 +399,11 @@ func (f *Fetcher) Wait() (err error) {
|
||||
}
|
||||
}
|
||||
if !selected {
|
||||
util.SafeRemove(filepath.Join(f.meta.Opts.Path, f.meta.Res.Name, file.Path()))
|
||||
// Path already includes the torrent's root directory.
|
||||
name := filepath.Join(f.meta.Opts.Path, file.Path())
|
||||
if err := util.SafeRemove(name); err != nil {
|
||||
return fmt.Errorf("remove unselected torrent file %q: %w", name, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user