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
This commit is contained in:
DC
2016-03-21 04:21:44 -07:00
parent 34a8afa9ec
commit 9fde82eda9

View File

@@ -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()
}