mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-28 20:25:10 +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:
|
try:
|
||||||
# libtorrent needs unicode object if wstrings are enabled, utf8 bytestring otherwise
|
# libtorrent needs unicode object if wstrings are enabled, utf8 bytestring otherwise
|
||||||
|
# Keyword argument flags=1 (fail_if_exist) stops overwriting of target files.
|
||||||
try:
|
try:
|
||||||
self.handle.move_storage(dest)
|
self.handle.move_storage(dest, flags=1)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
self.handle.move_storage(utf8_encoded(dest))
|
self.handle.move_storage(utf8_encoded(dest), flags=1)
|
||||||
except RuntimeError as ex:
|
except RuntimeError as ex:
|
||||||
log.error("Error calling libtorrent move_storage: %s", ex)
|
log.error("Error calling libtorrent move_storage: %s", ex)
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user