diff options
author | Calum Lind <calumlind@gmail.com> | 2018-11-16 12:14:58 +0000 |
---|---|---|
committer | Calum Lind <calumlind@gmail.com> | 2018-11-16 15:06:30 +0000 |
commit | 09d04aaac072e68d6f02ff1b0ca09a777a7e0095 (patch) | |
tree | cac52dd15a33b3604cdd4a183a1ea406e0fb1afa | |
parent | 27b4e2d891a198fcb179d6d649d938d2f613cf84 (diff) | |
download | deluge-09d04aaac072e68d6f02ff1b0ca09a777a7e0095.tar.gz deluge-09d04aaac072e68d6f02ff1b0ca09a777a7e0095.tar.bz2 deluge-09d04aaac072e68d6f02ff1b0ca09a777a7e0095.zip |
[Core] Fix showing incorrect file priorities
Removed previous workaround to ensure sync of file priorities with
libtorrent. This did not work when loading torrents as the status is
called before setting the file priorites and resets them to default.
Removed the call to set_file_priorities when writing the torrent file
to disk as it resets the options to default so although the torrent
file priorities do not change, the priorities for UIs is incorrect.
-rw-r--r-- | deluge/core/torrent.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index a2b1eb1e6..10e444cb5 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -1029,10 +1029,6 @@ class Torrent(object): status (libtorrent.torrent_status): a libtorrent torrent status """ self.status = status - # Ensure that the file_priorities are kept in sync with libtorrent. - # We do this here as file_priorities is async and can't call it - # immediately after setting priorities. - self.options['file_priorities'] = self.handle.file_priorities() def _create_status_funcs(self): """Creates the functions for getting torrent status""" @@ -1297,8 +1293,7 @@ class Torrent(object): log.error('Unable to save torrent file to: %s', ex) filepath = os.path.join(get_config_dir(), 'state', self.torrent_id + '.torrent') - # Regenerate the file priorities - self.set_file_priorities([]) + if filedump is None: metadata = lt.bdecode(self.torrent_info.metadata()) torrent_file = {b'info': metadata} |