aboutsummaryrefslogtreecommitdiff
path: root/meta/torrent.go
diff options
context:
space:
mode:
Diffstat (limited to 'meta/torrent.go')
-rw-r--r--meta/torrent.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/torrent.go b/meta/torrent.go
index 9a63fa8..33eebd2 100644
--- a/meta/torrent.go
+++ b/meta/torrent.go
@@ -28,8 +28,11 @@ type Info struct {
func (i Info) String() string {
var s string
- for _, f := range i.Files {
- s += fmt.Sprintln(f)
+ if l := len(i.Files); l > 0 {
+ s += fmt.Sprintln("files:", l)
+ for _, f := range i.Files {
+ s += fmt.Sprintln(f)
+ }
}
s += fmt.Sprintf("%s (%d)\n", i.Name, i.Length)
s += fmt.Sprintf("chunks: %d * %d + %d\n",
@@ -54,7 +57,7 @@ func (t Torrent) String() string {
s := fmt.Sprintf("announce: %s\n", t.Announce)
s += fmt.Sprintf("comment: %s\n", t.Comment)
s += fmt.Sprintf("date: %s\n", t.CreationDate)
- s += fmt.Sprintf("info: %v", t.Info)
+ s += fmt.Sprintf("%v", t.Info)
s += fmt.Sprintf("info hash: %x", t.InfoHash)
return s
}