aboutsummaryrefslogtreecommitdiff
path: root/meta/torrent.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-06-12 13:49:57 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-06-12 13:49:57 +0200
commitb07fbf65b5badc6af93c8ca804acce8f7186c8c6 (patch)
tree619675cdc3079deb2224d33ed1680c11731d2d9c /meta/torrent.go
parent083f0732796e8d9bef1db62375c851dcd990fae5 (diff)
minor cleanup
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
}