Fix received metadata handling

This commit is contained in:
Vladimir Golovnev (Glassez) 2020-12-02 09:17:13 +03:00 committed by sledgehammer999
parent 7cfe68f46c
commit 5f34d1555b
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
5 changed files with 154 additions and 47 deletions

View file

@ -1757,6 +1757,13 @@ void Session::handleDownloadFinished(const Net::DownloadResult &result)
void Session::fileSearchFinished(const InfoHash &id, const QString &savePath, const QStringList &fileNames)
{
TorrentHandleImpl *torrent = m_torrents.value(id);
if (torrent)
{
torrent->fileSearchFinished(savePath, fileNames);
return;
}
const auto loadingTorrentsIter = m_loadingTorrents.find(id);
if (loadingTorrentsIter != m_loadingTorrents.end())
{
@ -4571,7 +4578,7 @@ void Session::createTorrentHandle(const lt::torrent_handle &nativeHandle)
const LoadTorrentParams params = m_loadingTorrents.take(nativeHandle.info_hash());
auto *const torrent = new TorrentHandleImpl {this, nativeHandle, params};
auto *const torrent = new TorrentHandleImpl {this, m_nativeSession, nativeHandle, params};
m_torrents.insert(torrent->hash(), torrent);
const bool hasMetadata = torrent->hasMetadata();