1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-14 16:57:55 +00:00

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.
This commit is contained in:
Chocobo1 2018-05-10 05:43:27 +08:00
parent da75a010c7
commit 95b19ec303
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -781,10 +781,6 @@ bool TorrentHandle::hasFirstLastPiecePriority() const
if (filePriorities[i] <= 0) if (filePriorities[i] <= 0)
continue; continue;
const QString ext = Utils::Fs::fileExtension(filePath(i));
if (!Utils::Misc::isPreviewable(ext))
continue;
const TorrentInfo::PieceRange extremities = info().filePieces(i); const TorrentInfo::PieceRange extremities = info().filePieces(i);
const int firstPiecePrio = nativeHandle().piece_priority(extremities.first()); const int firstPiecePrio = nativeHandle().piece_priority(extremities.first());
const int lastPiecePrio = nativeHandle().piece_priority(extremities.last()); const int lastPiecePrio = nativeHandle().piece_priority(extremities.last());
@ -1303,10 +1299,6 @@ void TorrentHandle::setFirstLastPiecePriority(const bool enabled)
if (filePrio <= 0) if (filePrio <= 0)
continue; continue;
const QString ext = Utils::Fs::fileExtension(filePath(index));
if (!Utils::Misc::isPreviewable(ext))
continue;
// Determine the priority to set // Determine the priority to set
const int newPrio = enabled ? 7 : filePrio; const int newPrio = enabled ? 7 : filePrio;
const TorrentInfo::PieceRange extremities = info().filePieces(index); const TorrentInfo::PieceRange extremities = info().filePieces(index);