From: Matt Joiner Date: Mon, 1 Dec 2014 20:29:30 +0000 (-0600) Subject: torrent.String, if the name isn't available, use the info hash X-Git-Tag: v1.0.0~1454 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=cb75f49bf75e54f25a3b9ccc02e779cb07ac458b;p=btrtrc.git torrent.String, if the name isn't available, use the info hash --- diff --git a/torrent.go b/torrent.go index 78162aa0..1e4302b7 100644 --- a/torrent.go +++ b/torrent.go @@ -344,7 +344,11 @@ func (t *torrent) WriteStatus(w io.Writer) { } func (t *torrent) String() string { - return t.Name() + s := t.Name() + if s == "" { + s = fmt.Sprintf("%x", t.InfoHash) + } + return s } func (t *torrent) haveInfo() bool {