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/index.js b/renderer/index.js index 7a86a1ac..bfc0867a 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -72,7 +72,7 @@ function init () { dragDrop('body', onFiles) chromecasts.on('update', function (player) { - state.view.chromecast = player + state.view.devices.chromecast = player update() }) @@ -285,8 +285,8 @@ function deleteTorrent (torrent) { function openChromecast (torrent) { startServer(torrent, function () { - state.view.chromecast.play(state.server.networkURL, { title: 'WebTorrent — ' + torrent.name }) - state.view.chromecast.on('error', function (err) { + state.view.devices.chromecast.play(state.server.networkURL, { title: 'WebTorrent — ' + torrent.name }) + state.view.devices.chromecast.on('error', function (err) { err.message = 'Chromecast: ' + err.message onError(err) }) diff --git a/renderer/views/torrent-list.js b/renderer/views/torrent-list.js index ede1b111..35cc5943 100644 --- a/renderer/views/torrent-list.js +++ b/renderer/views/torrent-list.js @@ -49,16 +49,28 @@ function renderTorrent (state, dispatch, torrent) { // Renders the torrent name and download progress function renderTorrentMetadata (torrent) { + var progressPercent = 0 + var progressBytes = 0 + + if (torrent.progress) { + progressPercent = Math.floor(100 * torrent.progress) + } + + if (torrent.length && torrent.progress) { + progressBytes = torrent.length * torrent.progress + } + return hx`
${torrent.name || 'Loading torrent...'}
- ${Math.floor(100 * torrent.progress)}% + ${progressPercent}% + ${prettyBytes(progressBytes)} / ${prettyBytes(torrent.length || 0)}
${getFilesLength()} ${getPeers()} - ${prettyBytes(torrent.downloadSpeed)}/s - ${prettyBytes(torrent.uploadSpeed)}/s + ↓ ${prettyBytes(torrent.downloadSpeed || 0)}/s + ↑ ${prettyBytes(torrent.uploadSpeed || 0)}/s
`