From 3260db416aba9df64c2e5ab738e5fc0e11f5d31b Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 28 Nov 2016 19:18:48 +0000 Subject: [PATCH] [Core] Add a quick fix for lt1.1 default priority change --- deluge/core/torrent.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index e80fc4876..f98f2b019 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -492,7 +492,11 @@ class Torrent(object): return if len(file_priorities) != self.torrent_info.num_files(): log.debug('file_priorities len != num_files') - self.options['file_priorities'] = self.handle.file_priorities() + torrent_fprios = self.handle.file_priorities() + # Workaround for libtorrent 1.1 changing default priorities from 1 to 4. + if 4 in torrent_fprios: + torrent_fprios = [1 if x == 4 else x for x in torrent_fprios] + self.options['file_priorities'] = torrent_fprios return if log.isEnabledFor(logging.DEBUG):