From 46c379d556b744e3b30d9122cf2172acdfbcbf05 Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 10 Sep 2025 07:59:10 +0800 Subject: [PATCH] fix: resolve incorrect download path for single file torrent (#1111) --- internal/protocol/bt/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/protocol/bt/file.go b/internal/protocol/bt/file.go index b779adc7..5b2a1e26 100644 --- a/internal/protocol/bt/file.go +++ b/internal/protocol/bt/file.go @@ -34,7 +34,7 @@ func newFileOpts(opts newFileClientOpts) storage.ClientImplCloser { if opts.FilePathMaker == nil { opts.FilePathMaker = func(opts storage.FilePathMakerOpts) string { var parts []string - if opts.Info.Name != metainfo.NoName { + if opts.Info.Length == 0 { parts = append(parts, opts.Info.Name) } return filepath.Join(append(parts, opts.File.Path...)...)