fix: don't save blocks bitfield to resume when we are seed

This commit is contained in:
Yat Ho 2024-03-28 12:11:15 +08:00
parent 2ff3ae07d1
commit a586f8d743
1 changed files with 6 additions and 4 deletions

View File

@ -467,14 +467,16 @@ void saveProgress(tr_variant* dict, tr_torrent const* tor, tr_torrent::ResumeHel
// add the 'checked pieces' bitfield
bitfieldToRaw(helper.checked_pieces(), tr_variantDictAdd(prog, TR_KEY_pieces));
/* add the progress */
// add the progress
if (tor->is_seed())
{
// shortcut for faster load times for when we have all blocks
tr_variantDictAddStrView(prog, TR_KEY_have, "all"sv);
}
/* add the blocks bitfield */
bitfieldToRaw(helper.blocks(), tr_variantDictAdd(prog, TR_KEY_blocks));
else
{
bitfieldToRaw(helper.blocks(), tr_variantDictAdd(prog, TR_KEY_blocks));
}
}
/*