From cb75f49bf75e54f25a3b9ccc02e779cb07ac458b Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 1 Dec 2014 14:29:30 -0600 Subject: [PATCH] torrent.String, if the name isn't available, use the info hash --- torrent.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { -- 2.48.1