From 9c0038ac8e9298b536fa8519117ebf6c0cbd289f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20C=C5=93ur?= Date: Mon, 18 Apr 2022 14:03:44 +0800 Subject: [PATCH] Pause magnet download when "Start when added" is unchecked (#2902) Co-authored-by: Charles Kerr --- libtransmission/torrent-magnet.cc | 5 ++++- libtransmission/torrent.cc | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libtransmission/torrent-magnet.cc b/libtransmission/torrent-magnet.cc index 2167370eb..02cd6b73c 100644 --- a/libtransmission/torrent-magnet.cc +++ b/libtransmission/torrent-magnet.cc @@ -296,7 +296,10 @@ static void onHaveAllMetainfo(tr_torrent* tor, tr_incomplete_metadata* m) tor->incompleteMetadata = nullptr; tor->isStopping = true; tor->magnetVerify = true; - tor->startAfterVerify = !tr_sessionGetPaused(tor->session); + if (tr_sessionGetPaused(tor->session)) + { + tor->startAfterVerify = false; + } tor->markEdited(); } else /* drat. */ diff --git a/libtransmission/torrent.cc b/libtransmission/torrent.cc index 48a53f5d2..d3485f846 100644 --- a/libtransmission/torrent.cc +++ b/libtransmission/torrent.cc @@ -1455,6 +1455,7 @@ void tr_torrentStart(tr_torrent* tor) { if (tr_isTorrent(tor)) { + tor->startAfterVerify = true; torrentStart(tor, {}); } }