mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-27 11:45:44 +00:00
[#2703] [Core] Stop moving files if target files exist
This commit is contained in:
parent
7f2e06d4e2
commit
0838202892
@ -1089,10 +1089,11 @@ class Torrent(object):
|
||||
|
||||
try:
|
||||
# libtorrent needs unicode object if wstrings are enabled, utf8 bytestring otherwise
|
||||
# Keyword argument flags=1 (fail_if_exist) stops overwriting of target files.
|
||||
try:
|
||||
self.handle.move_storage(dest)
|
||||
self.handle.move_storage(dest, flags=1)
|
||||
except TypeError:
|
||||
self.handle.move_storage(utf8_encoded(dest))
|
||||
self.handle.move_storage(utf8_encoded(dest), flags=1)
|
||||
except RuntimeError as ex:
|
||||
log.error("Error calling libtorrent move_storage: %s", ex)
|
||||
return False
|
||||
|
Loading…
x
Reference in New Issue
Block a user