From 026bbe2a6f52b056099caeb865769ee4137cd3dd Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 4 Mar 2024 16:01:22 +1100 Subject: [PATCH] Use UpvertedFiles instead of raw Info.Files in a few places --- cmd/torrent/serve.go | 2 +- fs/torrentfs.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/torrent/serve.go b/cmd/torrent/serve.go index bdb15594..d37dafaf 100644 --- a/cmd/torrent/serve.go +++ b/cmd/torrent/serve.go @@ -44,7 +44,7 @@ func serve() (cmd bargle.Command) { if err != nil { return fmt.Errorf("building info from path %q: %w", filePath, err) } - for _, fi := range info.Files { + for _, fi := range info.UpvertedFiles() { log.Printf("added %q", fi.Path) } mi := metainfo.MetaInfo{ diff --git a/fs/torrentfs.go b/fs/torrentfs.go index 5e0b75ea..1b7b144e 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -72,7 +72,7 @@ func isSubPath(parent, child string) bool { func (dn dirNode) ReadDirAll(ctx context.Context) (des []fuse.Dirent, err error) { names := map[string]bool{} - for _, fi := range dn.metadata.Files { + for _, fi := range dn.metadata.UpvertedFiles() { filePathname := strings.Join(fi.Path, "/") if !isSubPath(dn.path, filePathname) { continue -- 2.48.1