Session saving of resume data is added to a pre-queue.

This commit is contained in:
Jari Sundell
2025-12-22 19:04:47 +01:00
committed by GitHub
parent 4bdeb58eb6
commit 4a37fbde0b
4 changed files with 287 additions and 130 deletions
+16 -5
View File
@@ -11,7 +11,7 @@ class Download;
}
namespace utils {
class Directory;
class Directory;
}
namespace session {
@@ -22,16 +22,27 @@ public:
core::Download* download() const { return m_download; }
void build_streams(bool skip_static);
std::string build_path(const std::string& session_path);
auto torrent_stream() { return std::move(m_torrent_stream); }
auto rtorrent_stream() { return std::move(m_rtorrent_stream); }
auto libtorrent_stream() { return std::move(m_libtorrent_stream); }
void build_full_streams() { build_streams(false); }
void build_resume_streams() { build_streams(true); }
void unlink_files(const std::string& session_path);
auto torrent_stream() { return std::move(m_torrent_stream); }
auto rtorrent_stream() { return std::move(m_rtorrent_stream); }
auto libtorrent_stream() { return std::move(m_libtorrent_stream); }
static void save_and_move_streams(const std::string& path, bool use_fsyncdisk,
const std::stringstream& torrent_stream,
const std::stringstream& rtorrent_stream,
const std::stringstream& libtorrent_stream);
static utils::Directory get_formated_entries(const std::string& session_path);
private:
void build_streams(bool skip_static);
core::Download* m_download;
std::unique_ptr<std::stringstream> m_torrent_stream;