From d2761b1603984a812a1a32b84831d039a91761b7 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Tue, 28 Aug 2007 23:19:09 +0000 Subject: [PATCH] fix for old torrents --- plugins/SpeedLimiter/__init__.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/plugins/SpeedLimiter/__init__.py b/plugins/SpeedLimiter/__init__.py index 96b8618ec..0a08acf04 100644 --- a/plugins/SpeedLimiter/__init__.py +++ b/plugins/SpeedLimiter/__init__.py @@ -77,16 +77,19 @@ class DesiredSpeed: self.up_speed_menuitem.show_all() for torrent in self.core.get_queue(): unique_ID = self.core.get_torrent_unique_id(torrent) - if self.core.unique_IDs[unique_ID].upload_rate_limit != -1: - self.core.set_per_upload_rate_limit(unique_ID, - self.core.unique_IDs[unique_ID].upload_rate_limit) - self.set_up_speeds[unique_ID] = \ - self.core.unique_IDs[unique_ID].upload_rate_limit / 1024 - if self.core.unique_IDs[unique_ID].download_rate_limit != -1: - self.core.set_per_download_rate_limit(unique_ID, - self.core.unique_IDs[unique_ID].download_rate_limit) - self.set_down_speeds[unique_ID] = \ - self.core.unique_IDs[unique_ID].download_rate_limit / 1024 + try: + if self.core.unique_IDs[unique_ID].upload_rate_limit != -1: + self.core.set_per_upload_rate_limit(unique_ID, + self.core.unique_IDs[unique_ID].upload_rate_limit) + self.set_up_speeds[unique_ID] = \ + self.core.unique_IDs[unique_ID].upload_rate_limit / 1024 + if self.core.unique_IDs[unique_ID].download_rate_limit != -1: + self.core.set_per_download_rate_limit(unique_ID, + self.core.unique_IDs[unique_ID].download_rate_limit) + self.set_down_speeds[unique_ID] = \ + self.core.unique_IDs[unique_ID].download_rate_limit / 1024 + except AttributeError: + pass def torrent_menu_hide(self, widget): try: