mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
parent
0729c9a2f8
commit
2cbfb91b88
2 changed files with 6 additions and 15 deletions
|
@ -37,10 +37,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libtorrent/address.hpp>
|
#include <libtorrent/address.hpp>
|
||||||
#include <libtorrent/create_torrent.hpp>
|
|
||||||
#include <libtorrent/session.hpp>
|
#include <libtorrent/session.hpp>
|
||||||
#include <libtorrent/storage_defs.hpp>
|
#include <libtorrent/storage_defs.hpp>
|
||||||
#include <libtorrent/time.hpp>
|
#include <libtorrent/time.hpp>
|
||||||
|
#include <libtorrent/write_resume_data.hpp>
|
||||||
|
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#ifdef QBT_USES_LIBTORRENT2
|
||||||
#include <libtorrent/info_hash.hpp>
|
#include <libtorrent/info_hash.hpp>
|
||||||
|
@ -2088,7 +2088,7 @@ void TorrentImpl::handleTorrentFinished()
|
||||||
m_hasFinishedStatus = true;
|
m_hasFinishedStatus = true;
|
||||||
|
|
||||||
if (isMoveInProgress() || (m_renameCount > 0))
|
if (isMoveInProgress() || (m_renameCount > 0))
|
||||||
m_moveFinishedTriggers.enqueue([this]() { m_session->handleTorrentFinished(this); });
|
m_moveFinishedTriggers.enqueue([this] { m_session->handleTorrentFinished(this); });
|
||||||
else
|
else
|
||||||
m_session->handleTorrentFinished(this);
|
m_session->handleTorrentFinished(this);
|
||||||
}
|
}
|
||||||
|
@ -2753,18 +2753,9 @@ nonstd::expected<lt::entry, QString> TorrentImpl::exportTorrent() const
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
[[maybe_unused]] const auto infoGuard = qScopeGuard([this] { m_ltAddTorrentParams.ti.reset(); });
|
||||||
const std::shared_ptr<lt::torrent_info> completeTorrentInfo = m_nativeHandle.torrent_file_with_hashes();
|
m_ltAddTorrentParams.ti = info().nativeInfo();
|
||||||
const std::shared_ptr<lt::torrent_info> torrentInfo = (completeTorrentInfo ? completeTorrentInfo : info().nativeInfo());
|
return lt::write_torrent_file(m_ltAddTorrentParams);
|
||||||
#else
|
|
||||||
const std::shared_ptr<lt::torrent_info> torrentInfo = info().nativeInfo();
|
|
||||||
#endif
|
|
||||||
lt::create_torrent creator {*torrentInfo};
|
|
||||||
|
|
||||||
for (const TrackerEntryStatus &status : asConst(trackers()))
|
|
||||||
creator.add_tracker(status.url.toStdString(), status.tier);
|
|
||||||
|
|
||||||
return creator.generate();
|
|
||||||
}
|
}
|
||||||
catch (const lt::system_error &err)
|
catch (const lt::system_error &err)
|
||||||
{
|
{
|
||||||
|
|
|
@ -373,7 +373,7 @@ namespace BitTorrent
|
||||||
|
|
||||||
bool m_unchecked = false;
|
bool m_unchecked = false;
|
||||||
|
|
||||||
lt::add_torrent_params m_ltAddTorrentParams;
|
mutable lt::add_torrent_params m_ltAddTorrentParams;
|
||||||
|
|
||||||
int m_downloadLimit = 0;
|
int m_downloadLimit = 0;
|
||||||
int m_uploadLimit = 0;
|
int m_uploadLimit = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue