fix(bt): remove unselected files from the correct download path

This commit is contained in:
Levi committed 2026-09-17 22:47:07 +08:00
1 parent a83e3a2b84
commit 967ef25408
2 files changed
+112 -1

No files matched your search

+5 -1
View File
@@ -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