]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Use UpvertedFiles instead of raw Info.Files in a few places
authorMatt Joiner <anacrolix@gmail.com>
Mon, 4 Mar 2024 05:01:22 +0000 (16:01 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 4 Mar 2024 05:01:22 +0000 (16:01 +1100)
cmd/torrent/serve.go
fs/torrentfs.go

index bdb1559473d463139d71342742d2f0012176bf94..d37dafafaac83fbd121206558e018eda1f983597 100644 (file)
@@ -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{
index 5e0b75ea18e4bd8a944124d9bddb94957148502d..1b7b144e78fb961b5b374c9a1461ca9e6559cda4 100644 (file)
@@ -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