torrent-metainfo-pprint: include the 'nodes' field into the output when non-empty

This commit is contained in:
Yaroslav Kolomiiets 2020-05-20 17:18:00 +01:00 committed by Matt Joiner
parent c04f09ee42
commit 6ea0344efd
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ func processReader(r io.Reader) error {
"AnnounceList": metainfo.AnnounceList,
"UrlList": metainfo.UrlList,
}
if len(metainfo.Nodes) > 0 {
d["Nodes"] = metainfo.Nodes
}
if flags.Files {
d["Files"] = info.UpvertedFiles()
}