From b6363fcf47293e881ffb4ef55e39a8c73f6856a4 Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Fri, 24 May 2024 23:12:30 +0800 Subject: [PATCH] fix: store seconds downloading/seeding when stopping torrent (#6844) * fix: save seconds downloading when stopping torrent * fix: save seconds seeding when stopping torrent --- libtransmission/torrent.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libtransmission/torrent.cc b/libtransmission/torrent.cc index 6a20157d6..49ded80ab 100644 --- a/libtransmission/torrent.cc +++ b/libtransmission/torrent.cc @@ -756,6 +756,10 @@ void tr_torrent::stop_now() TR_ASSERT(session->am_in_session_thread()); auto const lock = unique_lock(); + auto const now = tr_time(); + seconds_downloading_before_current_start_ = seconds_downloading(now); + seconds_seeding_before_current_start_ = seconds_seeding(now); + is_running_ = false; is_stopping_ = false; mark_changed();