From 4054cbbaeeb942e2f8f3cecff13711e9279fe631 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (glassez)" Date: Wed, 22 Jan 2020 11:45:11 +0300 Subject: [PATCH] store stop_when_ready flag in fastresume data --- src/read_resume_data.cpp | 1 + src/torrent.cpp | 1 + src/write_resume_data.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/read_resume_data.cpp b/src/read_resume_data.cpp index 7a13af4c1..8263ced88 100644 --- a/src/read_resume_data.cpp +++ b/src/read_resume_data.cpp @@ -156,6 +156,7 @@ namespace { apply_flag(ret.flags, rd, "auto_managed", torrent_flags::auto_managed); apply_flag(ret.flags, rd, "sequential_download", torrent_flags::sequential_download); apply_flag(ret.flags, rd, "paused", torrent_flags::paused); + apply_flag(ret.flags, rd, "stop_when_ready", torrent_flags::stop_when_ready); ret.save_path = rd.dict_find_string_value("save_path").to_string(); diff --git a/src/torrent.cpp b/src/torrent.cpp index 719da35e9..e68401824 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -6199,6 +6199,7 @@ bool is_downloading_state(int const st) if (m_super_seeding ) ret.flags |= torrent_flags::super_seeding; if (is_torrent_paused()) ret.flags |= torrent_flags::paused; if (m_auto_managed ) ret.flags |= torrent_flags::auto_managed; + if (m_stop_when_ready) ret.flags |= torrent_flags::stop_when_ready; ret.added_time = m_added_time; ret.completed_time = m_completed_time; diff --git a/src/write_resume_data.cpp b/src/write_resume_data.cpp index 51515f262..bd712a1fe 100644 --- a/src/write_resume_data.cpp +++ b/src/write_resume_data.cpp @@ -218,6 +218,7 @@ namespace libtorrent { ret["max_uploads"] = atp.upload_limit; ret["paused"] = bool(atp.flags & torrent_flags::paused); ret["auto_managed"] = bool(atp.flags & torrent_flags::auto_managed); + ret["stop_when_ready"] = bool(atp.flags & torrent_flags::stop_when_ready); if (!atp.file_priorities.empty()) {