mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-10 02:18:41 +00:00
Fixes an issue with clear_max_ratio_torrents and changes pause/resume block in
Manager.apply_queue() to use enumerate. Patch is from eternalswd, thanks.
This commit is contained in:
parent
3ec15816ac
commit
946a86c815
1 changed files with 2 additions and 4 deletions
|
@ -489,8 +489,7 @@ class Manager:
|
||||||
self.set_user_pause(unique_ID, True, enforce_queue=False)
|
self.set_user_pause(unique_ID, True, enforce_queue=False)
|
||||||
|
|
||||||
if self.get_pref('clear_max_ratio_torrents'):
|
if self.get_pref('clear_max_ratio_torrents'):
|
||||||
for index in range(len(self.state.queue)):
|
for unique_ID in self.state.queue:
|
||||||
unique_ID = self.state.queue[index]
|
|
||||||
torrent_state = self.get_core_torrent_state(unique_ID)
|
torrent_state = self.get_core_torrent_state(unique_ID)
|
||||||
if torrent_state['is_seed']:
|
if torrent_state['is_seed']:
|
||||||
ratio = self.calc_ratio(unique_ID, torrent_state)
|
ratio = self.calc_ratio(unique_ID, torrent_state)
|
||||||
|
@ -499,8 +498,7 @@ class Manager:
|
||||||
self.remove_torrent(unique_ID, False, True)
|
self.remove_torrent(unique_ID, False, True)
|
||||||
|
|
||||||
# Pause and resume torrents
|
# Pause and resume torrents
|
||||||
for index in range(len(self.state.queue)):
|
for index, unique_ID in enumerate(self.state.queue):
|
||||||
unique_ID = self.state.queue[index]
|
|
||||||
torrent_state = self.get_core_torrent_state(unique_ID)
|
torrent_state = self.get_core_torrent_state(unique_ID)
|
||||||
if (index < self.get_pref('max_active_torrents') or \
|
if (index < self.get_pref('max_active_torrents') or \
|
||||||
self.get_pref('max_active_torrents') == -1) and \
|
self.get_pref('max_active_torrents') == -1) and \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue