From ccfed4caa7dbe4c54ac53060b0eff2f61285210c Mon Sep 17 00:00:00 2001 From: DC Date: Mon, 21 Mar 2016 04:21:44 -0700 Subject: [PATCH] Notify completed torrents only if we actually DL'd them In other words, don't notify completed torrents if all we did was verify data files that were already on disk --- renderer/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/renderer/index.js b/renderer/index.js index e3d2927a..582322c2 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -484,16 +484,19 @@ function addTorrentEvents (torrent) { } function torrentDone () { - // UPdate the torrent summary + // Update the torrent summary var torrentSummary = getTorrentSummary(torrent.infoHash) torrentSummary.status = 'seeding' updateTorrentProgress() - // Notify the user that a torrent finished - if (!state.window.isFocused) { - state.dock.badge += 1 + // Notify the user that a torrent finished, but only if we actually DL'd at least part of it. + // Don't notify if we merely finished verifying data files that were already on disk. + if (torrent.received > 0) { + if (!state.window.isFocused) { + state.dock.badge += 1 + } + showDoneNotification(torrent) } - showDoneNotification(torrent) update() }