]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Improvements to written status
authorMatt Joiner <anacrolix@gmail.com>
Sat, 13 Sep 2014 17:43:11 +0000 (03:43 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 13 Sep 2014 17:43:11 +0000 (03:43 +1000)
torrent.go

index 771933838cf4ceb53d12bd1cb23d82236e37265e..6ac23114a1ba67b5a1de976763321550bc4d894e 100644 (file)
@@ -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)