From 0d8189efebce8a94fd7332cf838b49f4f7845bb6 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 10 May 2018 05:43:27 +0800 Subject: [PATCH] Relax behavior of "Download first and last piece first" Now it applies the setting to all files in torrent, no matter whether the file is previewable or not. Torrent client shouldn't be smart by deciding which file this option will be applied to, i.e. it should just follow the user's decision. --- src/base/bittorrent/torrenthandle.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index a4a9f7f4d..509fa67bd 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -786,10 +786,6 @@ bool TorrentHandle::hasFirstLastPiecePriority() const if (filePriorities[i] <= 0) continue; - const QString ext = Utils::Fs::fileExtension(filePath(i)); - if (!Utils::Misc::isPreviewable(ext)) - continue; - const TorrentInfo::PieceRange extremities = info().filePieces(i); const int firstPiecePrio = nativeHandle().piece_priority(extremities.first()); const int lastPiecePrio = nativeHandle().piece_priority(extremities.last()); @@ -1311,10 +1307,6 @@ void TorrentHandle::setFirstLastPiecePriority(const bool enabled) if (filePrio <= 0) continue; - const QString ext = Utils::Fs::fileExtension(filePath(index)); - if (!Utils::Misc::isPreviewable(ext)) - continue; - // Determine the priority to set const int newPrio = enabled ? 7 : filePrio; const TorrentInfo::PieceRange extremities = info().filePieces(index);