mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Merge pull request #10754 from glassez/fix-magnet
Disable "Upload mode" when start preloaded torrent. Closes #10751
This commit is contained in:
commit
6f6033cf1c
1 changed files with 5 additions and 2 deletions
|
@ -1865,10 +1865,13 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
|
||||||
--m_extraLimit;
|
--m_extraLimit;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Preloaded torrent is in "Upload mode" so we need to disable it
|
||||||
|
// otherwise the torrent never be downloaded (until application restart)
|
||||||
#if (LIBTORRENT_VERSION_NUM < 10200)
|
#if (LIBTORRENT_VERSION_NUM < 10200)
|
||||||
handle.auto_managed(false);
|
handle.auto_managed(false);
|
||||||
|
handle.set_upload_mode(false);
|
||||||
#else
|
#else
|
||||||
handle.set_flags(lt::torrent_flags::auto_managed);
|
handle.unset_flags(lt::torrent_flags::auto_managed | lt::torrent_flags::upload_mode);
|
||||||
#endif
|
#endif
|
||||||
handle.pause();
|
handle.pause();
|
||||||
}
|
}
|
||||||
|
@ -1962,7 +1965,7 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
|
||||||
#else
|
#else
|
||||||
p.flags &= ~lt::torrent_flags::seed_mode;
|
p.flags &= ~lt::torrent_flags::seed_mode;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fromMagnetUri) {
|
if (!fromMagnetUri) {
|
||||||
if (params.restored) {
|
if (params.restored) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue