mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
[#2703] [Core] Stop moving files if target files exist
This commit is contained in:
parent
7f2e06d4e2
commit
0838202892
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue