mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
[Core] Switch move_storage flag to dont_replace
This commit is contained in:
parent
dd30bad96a
commit
4a62c5eac2
1 changed files with 3 additions and 3 deletions
|
@ -1116,11 +1116,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.
|
# Keyword argument flags=2 (dont_replace) dont overwrite target files but delete source.
|
||||||
try:
|
try:
|
||||||
self.handle.move_storage(dest, flags=1)
|
self.handle.move_storage(dest, flags=2)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
self.handle.move_storage(utf8_encoded(dest), flags=1)
|
self.handle.move_storage(utf8_encoded(dest), flags=2)
|
||||||
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…
Add table
Add a link
Reference in a new issue