Author: andar

Revision: 6037

Log:
        Partial fix for #1103 if the per-torrent option for stopping at a ratio 
has been unchecked, then do 
not stop it at the global setting.

Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog   2009-12-17 21:27:04 UTC (rev 6036)
+++ branches/1.2_RC/ChangeLog   2009-12-17 21:40:21 UTC (rev 6037)
@@ -49,6 +49,8 @@
        * Fix the upload_plugin rpc method (was still using XML-RPC stuff)
        * Fix possible exception when upgrading from a 0.5 state file
        * Use metavar to modify the help output by optparse.
+       * Partial fix for #1103 if the per-torrent option for stopping at a 
ratio has
+         been unchecked, then do not stop it at the global setting.
 
 ==== Blocklist ====
        * Fix blocklist not working for all locales

Modified: branches/1.2_RC/deluge/core/torrentmanager.py
===================================================================
--- branches/1.2_RC/deluge/core/torrentmanager.py       2009-12-17 21:27:04 UTC 
(rev 6036)
+++ branches/1.2_RC/deluge/core/torrentmanager.py       2009-12-17 21:40:21 UTC 
(rev 6037)
@@ -254,6 +254,10 @@
     def update(self):
         for torrent_id, torrent in self.torrents.items():
             if self.config["stop_seed_at_ratio"] or 
torrent.options["stop_at_ratio"] and torrent.state not in ("Checking", 
"Allocating"):
+                # If the global setting is set, but the per-torrent isn't.. 
Just skip to the next torrent
+                # This is so that a user can turn-off the stop at ratio option 
on a per-torrent basis
+                if self.config["stop_seed_at_ratio"] and not 
torrent.options["stop_at_ratio"]:
+                    continue
                 stop_ratio = self.config["stop_seed_ratio"]
                 if torrent.options["stop_at_ratio"]:
                     stop_ratio = torrent.options["stop_ratio"]

Modified: trunk/deluge/core/torrentmanager.py
===================================================================
--- trunk/deluge/core/torrentmanager.py 2009-12-17 21:27:04 UTC (rev 6036)
+++ trunk/deluge/core/torrentmanager.py 2009-12-17 21:40:21 UTC (rev 6037)
@@ -254,6 +254,10 @@
     def update(self):
         for torrent_id, torrent in self.torrents.items():
             if self.config["stop_seed_at_ratio"] or 
torrent.options["stop_at_ratio"] and torrent.state not in ("Checking", 
"Allocating"):
+                # If the global setting is set, but the per-torrent isn't.. 
Just skip to the next torrent
+                # This is so that a user can turn-off the stop at ratio option 
on a per-torrent basis
+                if self.config["stop_seed_at_ratio"] and not 
torrent.options["stop_at_ratio"]:
+                    continue
                 stop_ratio = self.config["stop_seed_ratio"]
                 if torrent.options["stop_at_ratio"]:
                     stop_ratio = torrent.options["stop_ratio"]


--

You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.


Reply via email to