fix: save sequential download across sessions (#6746)

This commit is contained in:
Yat Ho 2024-04-01 04:01:05 +08:00 committed by GitHub
parent 0ee64695ca
commit e619718a1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View File

@ -735,6 +735,13 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
fields_loaded |= tr_resume::BandwidthPriority;
}
if (auto val = bool{};
(fields_to_load & tr_resume::SequentialDownload) != 0 && tr_variantDictFindBool(&top, TR_KEY_sequentialDownload, &val))
{
tor->set_sequential_download(val);
fields_loaded |= tr_resume::SequentialDownload;
}
if ((fields_to_load & tr_resume::Peers) != 0)
{
fields_loaded |= loadPeers(&top, tor);

View File

@ -44,6 +44,7 @@ auto inline constexpr Filenames = fields_t{ 1 << 20 };
auto inline constexpr Name = fields_t{ 1 << 21 };
auto inline constexpr Labels = fields_t{ 1 << 22 };
auto inline constexpr Group = fields_t{ 1 << 23 };
auto inline constexpr SequentialDownload = fields_t{ 1 << 24 };
auto inline constexpr All = ~fields_t{ 0 };

View File

@ -729,6 +729,7 @@ struct tr_torrent
{
sequential_download_ = is_sequential;
sequential_download_changed_.emit(this, is_sequential);
set_dirty();
}
}