From: Matt Joiner Date: Sat, 13 Sep 2014 17:43:11 +0000 (+1000) Subject: Improvements to written status X-Git-Tag: v1.0.0~1567 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=0217bc6163190e585bcef981d0e05b7d0a35beea;p=btrtrc.git Improvements to written status --- 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)