mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 14:53:44 +00:00
fix: bt resolve
This commit is contained in:
1 parent
0515ce6081
commit
e4f86097e8
2 files changed
+2
-2
No files matched your search
@@ -84,7 +84,7 @@ func (f *Fetcher) Resolve(req *base.Request) error {
|
|||||||
for i, file := range f.torrent.Files() {
|
for i, file := range f.torrent.Files() {
|
||||||
res.Files[i] = &base.FileInfo{
|
res.Files[i] = &base.FileInfo{
|
||||||
Name: filepath.Base(file.DisplayPath()),
|
Name: filepath.Base(file.DisplayPath()),
|
||||||
Path: util.Dir(path.Join(f.torrent.Info().Name, file.Path())),
|
Path: util.Dir(file.Path()),
|
||||||
Size: file.Length(),
|
Size: file.Length(),
|
||||||
}
|
}
|
||||||
res.Size += file.Length()
|
res.Size += file.Length()
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ func doResolve(t *testing.T, fetcher fetcher.Fetcher) {
|
|||||||
Name: "ubuntu-22.04-live-server-amd64.iso",
|
Name: "ubuntu-22.04-live-server-amd64.iso",
|
||||||
Size: 1466714112,
|
Size: 1466714112,
|
||||||
Range: true,
|
Range: true,
|
||||||
|
RootDir: "ubuntu-22.04-live-server-amd64.iso",
|
||||||
Files: []*base.FileInfo{
|
Files: []*base.FileInfo{
|
||||||
{
|
{
|
||||||
Name: "ubuntu-22.04-live-server-amd64.iso",
|
Name: "ubuntu-22.04-live-server-amd64.iso",
|
||||||
Path: "ubuntu-22.04-live-server-amd64.iso",
|
|
||||||
Size: 1466714112,
|
Size: 1466714112,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user