From 0a01aa28b00a2c0fe02f2cd9a526d05dd9f5585d Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 18 Sep 2015 22:44:43 +0100 Subject: [PATCH] [#2402] [Notification] Fix popup to show actual count of files finished --- deluge/plugins/notifications/notifications/gtkui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deluge/plugins/notifications/notifications/gtkui.py b/deluge/plugins/notifications/notifications/gtkui.py index 17f43c62d..f687e45b2 100644 --- a/deluge/plugins/notifications/notifications/gtkui.py +++ b/deluge/plugins/notifications/notifications/gtkui.py @@ -227,7 +227,7 @@ class GtkUiNotifications(CustomNotifications): return '' def _on_torrent_finished_event_popup(self, torrent_id): - d = client.core.get_torrent_status(torrent_id, ["name", "num_files"]) + d = client.core.get_torrent_status(torrent_id, ["name", "file_progress"]) d.addCallback(self._on_torrent_finished_event_got_torrent_status) d.addErrback(self._on_torrent_finished_event_torrent_status_failure) return d @@ -239,6 +239,7 @@ class GtkUiNotifications(CustomNotifications): log.debug("Handler for TorrentFinishedEvent GTKUI called. " "Got Torrent Status") title = _("Finished Torrent") + torrent_status["num_files"] = torrent_status["file_progress"].count(1.0) message = _("The torrent \"%(name)s\" including %(num_files)i file(s) " "has finished downloading.") % torrent_status return title, message