mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Find complete files when checking torrent
This commit is contained in:
parent
a1faef0a3c
commit
4a1e3de06d
5 changed files with 165 additions and 7 deletions
|
@ -94,6 +94,7 @@
|
|||
#include "base/utils/net.h"
|
||||
#include "base/utils/random.h"
|
||||
#include "bandwidthscheduler.h"
|
||||
#include "customstorage.h"
|
||||
#include "filterparserthread.h"
|
||||
#include "ltunderlyingtype.h"
|
||||
#include "magneturi.h"
|
||||
|
@ -2456,6 +2457,8 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
|
|||
p.max_connections = maxConnectionsPerTorrent();
|
||||
p.max_uploads = maxUploadsPerTorrent();
|
||||
|
||||
p.storage = customStorageConstructor;
|
||||
|
||||
m_addingTorrents.insert(hash, params);
|
||||
// Adding torrent to BitTorrent session
|
||||
m_nativeSession->async_add_torrent(p);
|
||||
|
@ -2528,21 +2531,23 @@ bool Session::loadMetadata(const MagnetUri &magnetUri)
|
|||
const QString savePath = Utils::Fs::tempPath() + static_cast<QString>(hash);
|
||||
p.save_path = Utils::Fs::toNativePath(savePath).toStdString();
|
||||
|
||||
// Forced start
|
||||
#if (LIBTORRENT_VERSION_NUM < 10200)
|
||||
// Forced start
|
||||
p.flags &= ~lt::add_torrent_params::flag_paused;
|
||||
p.flags &= ~lt::add_torrent_params::flag_auto_managed;
|
||||
#else
|
||||
p.flags &= ~lt::torrent_flags::paused;
|
||||
p.flags &= ~lt::torrent_flags::auto_managed;
|
||||
#endif
|
||||
|
||||
// Solution to avoid accidental file writes
|
||||
#if (LIBTORRENT_VERSION_NUM < 10200)
|
||||
p.flags |= lt::add_torrent_params::flag_upload_mode;
|
||||
#else
|
||||
// Forced start
|
||||
p.flags &= ~lt::torrent_flags::paused;
|
||||
p.flags &= ~lt::torrent_flags::auto_managed;
|
||||
|
||||
// Solution to avoid accidental file writes
|
||||
p.flags |= lt::torrent_flags::upload_mode;
|
||||
#endif
|
||||
|
||||
p.storage = customStorageConstructor;
|
||||
#endif
|
||||
|
||||
// Adding torrent to BitTorrent session
|
||||
lt::error_code ec;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue