diff --git a/src/core.py b/src/core.py index ad81c0937..0ba1e5d11 100644 --- a/src/core.py +++ b/src/core.py @@ -507,7 +507,7 @@ class Manager: for unique_ID in self.unique_IDs: torrent_state = self.get_core_torrent_state(unique_ID) - if torrent_state['is_seed']: + if torrent_state['is_seed'] and not torrent_state['is_paused']: ratio = self.calc_ratio(unique_ID, torrent_state) if ratio >= self.get_pref('auto_seed_ratio'): self.queue_bottom(unique_ID, enforce_queue=False) # don't recurse! diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index 994b7898d..4282e1e28 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -763,6 +763,8 @@ static PyObject *torrent_has_piece(PyObject *self, PyObject *args) return NULL; torrent_status s = M_torrents->at(index).handle.status(); + if ((*s.pieces).size() == 0) + return Py_BuildValue("b", false); has_piece = internal_has_piece(*s.pieces, piece_index); return Py_BuildValue("b", has_piece); }