mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 05:47:50 +00:00
Fix do not create torrentfiles folder unless 'copy_torrent_file' is True
Fix some libtorrent asserts when using debug build
This commit is contained in:
parent
92f2b369ca
commit
5784b2adbb
@ -728,11 +728,11 @@ class Core(
|
||||
self.config_value_changed(key, value)
|
||||
|
||||
def _on_set_torrentfiles_location(self, key, value):
|
||||
# First try to create the new directory
|
||||
try:
|
||||
os.makedirs(value)
|
||||
except Exception, e:
|
||||
log.debug("Unable to make directory: %s", e)
|
||||
if self.config["copy_torrent_file"]:
|
||||
try:
|
||||
os.makedirs(value)
|
||||
except Exception, e:
|
||||
log.debug("Unable to make directory: %s", e)
|
||||
|
||||
def _on_set_state_location(self, key, value):
|
||||
if not os.access(value, os.F_OK):
|
||||
@ -845,12 +845,21 @@ class Core(
|
||||
def _on_set_max_upload_speed(self, key, value):
|
||||
log.debug("max_upload_speed set to %s..", value)
|
||||
# We need to convert Kb/s to B/s
|
||||
self.session.set_upload_rate_limit(int(value * 1024))
|
||||
if value < 0:
|
||||
v = -1
|
||||
else:
|
||||
v = int(value * 1024)
|
||||
|
||||
self.session.set_upload_rate_limit(v)
|
||||
|
||||
def _on_set_max_download_speed(self, key, value):
|
||||
log.debug("max_download_speed set to %s..", value)
|
||||
# We need to convert Kb/s to B/s
|
||||
self.session.set_download_rate_limit(int(value * 1024))
|
||||
if value < 0:
|
||||
v = -1
|
||||
else:
|
||||
v = int(value * 1024)
|
||||
self.session.set_download_rate_limit(v)
|
||||
|
||||
def _on_set_max_upload_slots_global(self, key, value):
|
||||
log.debug("max_upload_slots_global set to %s..", value)
|
||||
|
@ -151,11 +151,20 @@ class Torrent:
|
||||
|
||||
def set_max_upload_speed(self, m_up_speed):
|
||||
self.max_upload_speed = m_up_speed
|
||||
self.handle.set_upload_limit(int(m_up_speed * 1024))
|
||||
if m_up_speed < 0:
|
||||
v = -1
|
||||
else:
|
||||
v = int(m_up_speed * 1024)
|
||||
|
||||
self.handle.set_upload_limit(v)
|
||||
|
||||
def set_max_download_speed(self, m_down_speed):
|
||||
self.max_download_speed = m_down_speed
|
||||
self.handle.set_download_limit(int(m_down_speed * 1024))
|
||||
if m_down_speed < 0:
|
||||
v = -1
|
||||
else:
|
||||
v = int(m_down_speed * 1024)
|
||||
self.handle.set_download_limit(v)
|
||||
|
||||
def set_prioritize_first_last(self, prioritize):
|
||||
self.prioritize_first_last = prioritize
|
||||
|
Loading…
x
Reference in New Issue
Block a user