one for max ratio queuing and one for torrent pieces - micah

This commit is contained in:
Marcos Pinto 2007-08-06 23:17:21 +00:00
parent 5c0a649a65
commit a5d5cb7f4b
2 changed files with 3 additions and 1 deletions

View File

@ -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!

View File

@ -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);
}