From 043f81996e182fc115596828f9647f9670cbd736 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Mar 2017 19:50:49 -0300 Subject: [PATCH] fixed styling issues; returning early in pauseActiveTorrents. --- src/renderer/controllers/playback-controller.js | 12 ++++++------ src/renderer/controllers/torrent-list-controller.js | 2 +- src/renderer/pages/preferences-page.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/renderer/controllers/playback-controller.js b/src/renderer/controllers/playback-controller.js index 9749032e..8288baa3 100644 --- a/src/renderer/controllers/playback-controller.js +++ b/src/renderer/controllers/playback-controller.js @@ -88,13 +88,13 @@ module.exports = class PlaybackController { pauseActiveTorrents (infoHash) { // Playback Priority: pause all active torrents if needed. - if (this.state.saved.prefs.highestPlaybackPriority) { - // Do not pause active torrents if playing a fully downloaded torrent. - var torrentSummary = TorrentSummary.getByKey(this.state, infoHash) - if (torrentSummary.status === 'seeding') return + if (!this.state.saved.prefs.highestPlaybackPriority) return - dispatch('prioritizeTorrent', infoHash) - } + // Do not pause active torrents if playing a fully downloaded torrent. + const torrentSummary = TorrentSummary.getByKey(this.state, infoHash) + if (torrentSummary.status === 'seeding') return + + dispatch('prioritizeTorrent', infoHash) } // Play next file in list (if any) diff --git a/src/renderer/controllers/torrent-list-controller.js b/src/renderer/controllers/torrent-list-controller.js index de95c1c5..12cee063 100644 --- a/src/renderer/controllers/torrent-list-controller.js +++ b/src/renderer/controllers/torrent-list-controller.js @@ -122,7 +122,7 @@ module.exports = class TorrentListController { this.startTorrentingSummary(torrentSummary.torrentKey) sound.play('ENABLE') return - } + } this.pauseTorrent(torrentSummary, true) } diff --git a/src/renderer/pages/preferences-page.js b/src/renderer/pages/preferences-page.js index e547f4d3..bf729141 100644 --- a/src/renderer/pages/preferences-page.js +++ b/src/renderer/pages/preferences-page.js @@ -69,7 +69,7 @@ class PreferencesPage extends React.Component { className='control' checked={this.props.state.unsaved.prefs.highestPlaybackPriority} label={'Highest Playback Priority'} - onCheck={this.handleHighestPlaybackPriorityChange} + onCheck={this.handleHighestPlaybackPriorityChange} />

Pauses all active torrents to allow playback to use all of the available bandwidth.