fix: resolve incorrect download path for single file torrent (#1111)

This commit is contained in:
Levi authored and GitHub committed 2025-09-10 07:59:10 +08:00
1 parent 46cd9f7a3e
commit 46c379d556
1 file changed
+1 -1
+1 -1
View File
@@ -34,7 +34,7 @@ func newFileOpts(opts newFileClientOpts) storage.ClientImplCloser {
if opts.FilePathMaker == nil { if opts.FilePathMaker == nil {
opts.FilePathMaker = func(opts storage.FilePathMakerOpts) string { opts.FilePathMaker = func(opts storage.FilePathMakerOpts) string {
var parts []string var parts []string
if opts.Info.Name != metainfo.NoName { if opts.Info.Length == 0 {
parts = append(parts, opts.Info.Name) parts = append(parts, opts.Info.Name)
} }
return filepath.Join(append(parts, opts.File.Path...)...) return filepath.Join(append(parts, opts.File.Path...)...)