mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-05 03:14:44 +00:00
Mark all files as complete if torrent is in "seed mode"
Fixes regression of bcfa486. Closes #16999. PR #17008.
This commit is contained in:
parent
a266599118
commit
338e89176d
@ -287,11 +287,12 @@ TorrentImpl::TorrentImpl(Session *session, lt::session *nativeSession
|
||||
m_filePaths.reserve(filesCount);
|
||||
m_indexMap.reserve(filesCount);
|
||||
m_filePriorities.reserve(filesCount);
|
||||
m_completedFiles.resize(filesCount);
|
||||
const std::vector<lt::download_priority_t> filePriorities =
|
||||
resized(m_ltAddTorrentParams.file_priorities, m_ltAddTorrentParams.ti->num_files()
|
||||
, LT::toNative(m_ltAddTorrentParams.file_priorities.empty() ? DownloadPriority::Normal : DownloadPriority::Ignored));
|
||||
|
||||
m_completedFiles.fill(static_cast<bool>(m_ltAddTorrentParams.flags & lt::torrent_flags::seed_mode), filesCount);
|
||||
|
||||
for (int i = 0; i < filesCount; ++i)
|
||||
{
|
||||
const lt::file_index_t nativeIndex = m_torrentInfo.nativeIndexes().at(i);
|
||||
@ -1531,11 +1532,13 @@ void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathLi
|
||||
const std::shared_ptr<lt::torrent_info> metadata = std::const_pointer_cast<lt::torrent_info>(nativeTorrentInfo());
|
||||
m_torrentInfo = TorrentInfo(*metadata);
|
||||
m_filePriorities.reserve(filesCount());
|
||||
m_completedFiles.resize(filesCount());
|
||||
const auto nativeIndexes = m_torrentInfo.nativeIndexes();
|
||||
const std::vector<lt::download_priority_t> filePriorities =
|
||||
resized(p.file_priorities, metadata->files().num_files()
|
||||
, LT::toNative(p.file_priorities.empty() ? DownloadPriority::Normal : DownloadPriority::Ignored));
|
||||
|
||||
m_completedFiles.fill(static_cast<bool>(p.flags & lt::torrent_flags::seed_mode), filesCount());
|
||||
|
||||
for (int i = 0; i < fileNames.size(); ++i)
|
||||
{
|
||||
const auto nativeIndex = nativeIndexes.at(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user