Skip to content

Commit

Permalink
Use UpvertedFiles instead of raw Info.Files in a few places
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Mar 4, 2024
1 parent 188f5bb commit 026bbe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/torrent/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion fs/torrentfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 026bbe2

Please sign in to comment.