|
|
|
@ -1598,7 +1598,8 @@ void TorrentImpl::applyFirstLastPiecePriority(const bool enabled)
@@ -1598,7 +1598,8 @@ void TorrentImpl::applyFirstLastPiecePriority(const bool enabled)
|
|
|
|
|
|
|
|
|
|
void TorrentImpl::fileSearchFinished(const Path &savePath, const PathList &fileNames) |
|
|
|
|
{ |
|
|
|
|
endReceivedMetadataHandling(savePath, fileNames); |
|
|
|
|
if (m_maintenanceJob == MaintenanceJob::HandleMetadata) |
|
|
|
|
endReceivedMetadataHandling(savePath, fileNames); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TrackerEntry TorrentImpl::updateTrackerEntry(const lt::announce_entry &announceEntry, const QMap<TrackerEntry::Endpoint, int> &updateInfo) |
|
|
|
@ -1630,7 +1631,13 @@ std::shared_ptr<const libtorrent::torrent_info> TorrentImpl::nativeTorrentInfo()
@@ -1630,7 +1631,13 @@ std::shared_ptr<const libtorrent::torrent_info> TorrentImpl::nativeTorrentInfo()
|
|
|
|
|
|
|
|
|
|
void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathList &fileNames) |
|
|
|
|
{ |
|
|
|
|
Q_ASSERT(m_maintenanceJob == MaintenanceJob::HandleMetadata); |
|
|
|
|
if (m_maintenanceJob != MaintenanceJob::HandleMetadata) [[unlikely]] |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
Q_ASSERT(m_filePaths.isEmpty()); |
|
|
|
|
if (!m_filePaths.isEmpty()) [[unlikely]] |
|
|
|
|
m_filePaths.clear(); |
|
|
|
|
|
|
|
|
|
lt::add_torrent_params &p = m_ltAddTorrentParams; |
|
|
|
|
|
|
|
|
@ -1639,7 +1646,7 @@ void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathLi
@@ -1639,7 +1646,7 @@ void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathLi
|
|
|
|
|
m_filePriorities.reserve(filesCount()); |
|
|
|
|
const auto nativeIndexes = m_torrentInfo.nativeIndexes(); |
|
|
|
|
p.file_priorities = resized(p.file_priorities, metadata->files().num_files() |
|
|
|
|
, LT::toNative(p.file_priorities.empty() ? DownloadPriority::Normal : DownloadPriority::Ignored)); |
|
|
|
|
, LT::toNative(p.file_priorities.empty() ? DownloadPriority::Normal : DownloadPriority::Ignored)); |
|
|
|
|
|
|
|
|
|
m_completedFiles.fill(static_cast<bool>(p.flags & lt::torrent_flags::seed_mode), filesCount()); |
|
|
|
|
m_filesProgress.resize(filesCount()); |
|
|
|
|