Skip to content

Commit

Permalink
Fixes #5762: unset 'auto_managed' flag to prevent torrents resuming a…
Browse files Browse the repository at this point in the history
…utomatically
  • Loading branch information
kozlovsky authored and ichorid committed Dec 2, 2020
1 parent f254bbb commit 42c3385
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tribler-core/tribler_core/modules/libtorrent/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ def on_add_torrent_alert(self, alert):

self.handle = alert.handle
self._logger.debug("Added torrent %s", str(self.handle.info_hash()))
# In LibTorrent auto_managed flag is now on by default, and as a result
# any torrent's state can change from Stopped to Downloading at any time.
# Here we unset this flag to prevent auto-resuming of stopped torrents.
if hasattr(self.handle, 'unset_flags'):
self.handle.unset_flags(lt.add_torrent_params_flags_t.flag_auto_managed)

self.set_selected_files()

Expand Down

0 comments on commit 42c3385

Please sign in to comment.