mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-11 10:56:39 +00:00
Try 2 to fix per torrent preferences after resume. Do it in deluge's core for
now, not in libtorrent.
This commit is contained in:
parent
e624334b6a
commit
a011e939c9
17
src/core.py
17
src/core.py
@ -543,7 +543,7 @@ class Manager:
|
|||||||
self.is_user_paused(unique_ID):
|
self.is_user_paused(unique_ID):
|
||||||
# This torrent is a seed so skip all the free space checking
|
# This torrent is a seed so skip all the free space checking
|
||||||
if torrent_state['is_seed']:
|
if torrent_state['is_seed']:
|
||||||
deluge_core.resume(unique_ID)
|
self.resume(unique_ID)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Before we resume, we should check if the torrent is using Full Allocation
|
# Before we resume, we should check if the torrent is using Full Allocation
|
||||||
@ -553,16 +553,16 @@ class Manager:
|
|||||||
total_needed = torrent_state["total_size"] - torrent_state["total_done"]
|
total_needed = torrent_state["total_size"] - torrent_state["total_done"]
|
||||||
if total_needed < avail:
|
if total_needed < avail:
|
||||||
# We have enough free space, so lets resume this torrent
|
# We have enough free space, so lets resume this torrent
|
||||||
deluge_core.resume(unique_ID)
|
self.resume(unique_ID)
|
||||||
else:
|
else:
|
||||||
print "Not enough free space to resume this torrent!"
|
print "Not enough free space to resume this torrent!"
|
||||||
else: #We're using compact allocation so lets just resume
|
else: #We're using compact allocation so lets just resume
|
||||||
deluge_core.resume(unique_ID)
|
self.resume(unique_ID)
|
||||||
elif not torrent_state['is_paused'] and \
|
elif not torrent_state['is_paused'] and \
|
||||||
((active_torrent_cnt > self.get_pref('max_active_torrents') and \
|
((active_torrent_cnt > self.get_pref('max_active_torrents') and \
|
||||||
self.get_pref('max_active_torrents') != -1) or \
|
self.get_pref('max_active_torrents') != -1) or \
|
||||||
self.is_user_paused(unique_ID)):
|
self.is_user_paused(unique_ID)):
|
||||||
deluge_core.pause(unique_ID)
|
self.pause(unique_ID)
|
||||||
|
|
||||||
# Event handling
|
# Event handling
|
||||||
|
|
||||||
@ -727,6 +727,15 @@ class Manager:
|
|||||||
def update_tracker(self, unique_ID):
|
def update_tracker(self, unique_ID):
|
||||||
deluge_core.reannounce(unique_ID)
|
deluge_core.reannounce(unique_ID)
|
||||||
|
|
||||||
|
def pause(self, unique_ID):
|
||||||
|
deluge_core.pause(unique_ID)
|
||||||
|
|
||||||
|
def resume(self, unique_ID):
|
||||||
|
deluge_core.resume(unique_ID)
|
||||||
|
# We have to re-apply per torrent settings after resume. This has to
|
||||||
|
# be done until ticket #118 in libtorrent is fixed.
|
||||||
|
self.apply_prefs_per_torrent(unique_ID)
|
||||||
|
|
||||||
def pause_all(self):
|
def pause_all(self):
|
||||||
for unique_ID in self.state.queue:
|
for unique_ID in self.state.queue:
|
||||||
torrent_state = self.get_core_torrent_state(unique_ID)
|
torrent_state = self.get_core_torrent_state(unique_ID)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user