From 62c369bb6f0be863315a15708faad5b901f8858d Mon Sep 17 00:00:00 2001 From: Alex Dedul Date: Tue, 14 Aug 2007 21:55:47 +0000 Subject: [PATCH] Set desired ratio to 1.0 by default for all torrents. --- plugins/DesiredRatio/__init__.py | 7 ++----- src/deluge_core.cpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/DesiredRatio/__init__.py b/plugins/DesiredRatio/__init__.py index 247a5ad14..051ef0be9 100644 --- a/plugins/DesiredRatio/__init__.py +++ b/plugins/DesiredRatio/__init__.py @@ -97,7 +97,7 @@ class DesiredRatio: def ratio_clicked(self, widget): value = widget.get_children()[0].get_text() if value == _("Not Set"): - value = -1 + value = 0.0 if value == _("Other..."): dialog_glade = gtk.glade.XML(deluge.common.get_glade_file("dgtkpopups.glade")) @@ -130,7 +130,4 @@ class DesiredRatio: self.config.get("ratios").pop() def get_torrent_desired_ratio(self): - if self.set_ratios.has_key(self.unique_ID): - return self.set_ratios[self.unique_ID] - else: - return -1 + return self.set_ratios.get(self.unique_ID, 1) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index cf3a661c8..1679fa1f9 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -632,7 +632,7 @@ static PyObject *torrent_add_torrent(PyObject *self, PyObject *args) boost::filesystem::path save_dir_2 (save_dir, empty_name_check); try { - long ret = internal_add_torrent(name, 0, compact, save_dir_2); + long ret = internal_add_torrent(name, 1.0, compact, save_dir_2); if (PyErr_Occurred()) return NULL; else