not resuming a torrent if there is no need

This commit is contained in:
JohnDoee
2015-02-03 12:44:37 +01:00
parent c746b82e51
commit da02a94244

View File

@@ -341,8 +341,8 @@ class TorrentHandler(object):
self.priorities[f['index']] = 3
self.update_priorities()
self.torrent.resume()
if progress < 1:
self.torrent.resume()
percent_pieces = int(math.ceil((len(f['pieces']) / 100.0) * EXPECTED_PERCENT))
size_pieces = int(min(math.ceil((EXPECTED_SIZE * 1.0) / piece_length), f['pieces']))