show piece progress

This commit is contained in:
Zlatin Balevsky
2019-05-31 08:56:44 +01:00
parent a16d9ab7f9
commit 1081f4bcd0
2 changed files with 7 additions and 0 deletions

View File

@@ -140,6 +140,8 @@ class DownloadSession {
}
synchronized int positionInPiece() {
if (mapped == null)
return 0
mapped.position()
}
}

View File

@@ -90,6 +90,11 @@ class MainFrameView {
int done = row.downloader.donePieces()
"$done/$pieces pieces"
})
closureColumn(header: "Piece", type: String, read: { row ->
int position = row.downloader.positionInPiece()
int pieceSize = row.downloader.pieceSize // TODO: fix for last piece
"$position/$pieceSize bytes"
})
}
}
}