diff --git a/renderer/views/torrent-list.js b/renderer/views/torrent-list.js index ff40d214..9681f213 100644 --- a/renderer/views/torrent-list.js +++ b/renderer/views/torrent-list.js @@ -45,23 +45,18 @@ function renderTorrent (torrent, dispatch) { // Renders the torrent name and download progress function renderTorrentMetadata (torrent) { - var progressPercent = 0 - var progressBytes = 0 + var progress = Math.floor(100 * (torrent.progress || 0)) + var downloaded = prettyBytes(torrent.downloaded || 0) + var total = prettyBytes(torrent.length || 0) - if (torrent.progress) { - progressPercent = Math.floor(100 * torrent.progress) - } - - if (torrent.length && torrent.progress) { - progressBytes = torrent.length * torrent.progress - } + if (downloaded !== total) downloaded += ` / ${total}` return hx`
${torrent.name || 'Loading torrent...'}
- ${progressPercent}% - ${prettyBytes(progressBytes)} / ${prettyBytes(torrent.length || 0)} + ${progress}% + ${downloaded}
${getFilesLength()} ${getPeers()}