From 90a109407336f0e50623decbf1d60b162627f855 Mon Sep 17 00:00:00 2001 From: Nate Goldman Date: Sat, 5 Mar 2016 10:50:53 -0800 Subject: [PATCH 1/4] improve torrent metadata display --- renderer/index.css | 2 +- renderer/views/torrent-list.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/renderer/index.css b/renderer/index.css index 4568754c..9975a0e4 100644 --- a/renderer/index.css +++ b/renderer/index.css @@ -266,7 +266,7 @@ body.drag::before { bottom: 20px; } -.torrent .status :not(:last-child)::after { +.torrent span:not(:last-child)::after { content: ' — '; } diff --git a/renderer/views/torrent-list.js b/renderer/views/torrent-list.js index ede1b111..7ab87cc4 100644 --- a/renderer/views/torrent-list.js +++ b/renderer/views/torrent-list.js @@ -49,16 +49,18 @@ function renderTorrent (state, dispatch, torrent) { // Renders the torrent name and download progress function renderTorrentMetadata (torrent) { + var progress = Math.floor(100 * torrent.progress) return hx`
${torrent.name || 'Loading torrent...'}
- ${Math.floor(100 * torrent.progress)}% + ${progress}% + ${prettyBytes((torrent.length / 100) * progress)} / ${prettyBytes(torrent.length)}
${getFilesLength()} ${getPeers()} - ${prettyBytes(torrent.downloadSpeed)}/s - ${prettyBytes(torrent.uploadSpeed)}/s + ↓ ${prettyBytes(torrent.downloadSpeed)}/s + ↑ ${prettyBytes(torrent.uploadSpeed)}/s
` From 4a4d5cc4ed40fd56b95fb86fb0c0fea2e85e20bf Mon Sep 17 00:00:00 2001 From: Nate Goldman Date: Sat, 5 Mar 2016 11:13:08 -0800 Subject: [PATCH 2/4] better approximation of byte progress --- renderer/views/torrent-list.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/renderer/views/torrent-list.js b/renderer/views/torrent-list.js index 7ab87cc4..718438d4 100644 --- a/renderer/views/torrent-list.js +++ b/renderer/views/torrent-list.js @@ -49,13 +49,12 @@ function renderTorrent (state, dispatch, torrent) { // Renders the torrent name and download progress function renderTorrentMetadata (torrent) { - var progress = Math.floor(100 * torrent.progress) return hx`