From 0217bc6163190e585bcef981d0e05b7d0a35beea Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 14 Sep 2014 03:43:11 +1000 Subject: [PATCH] Improvements to written status --- torrent.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/torrent.go b/torrent.go index 77193383..6ac23114 100644 --- a/torrent.go +++ b/torrent.go @@ -250,6 +250,8 @@ func (t *torrent) pieceStatusChar(index int) byte { return 'H' case t.PiecePartiallyDownloaded(index): return 'P' + case !p.EverHashed: + return '?' default: return '.' } @@ -287,8 +289,11 @@ func (t *torrent) WriteStatus(w io.Writer) { return "?" } }()) - fmt.Fprint(w, "Pieces: ") + fmt.Fprint(w, "Pieces:") for index := range t.Pieces { + if index%100 == 0 { + fmt.Fprintln(w) + } fmt.Fprintf(w, "%c", t.pieceStatusChar(index)) } fmt.Fprintln(w) -- 2.48.1