Misc. changes
This commit is contained in:
@@ -80,18 +80,26 @@ void CSiaApi::_CSiaRenter::AutoThreadCallback(const CSiaCurl& siaCurl)
|
||||
fileTree->BuildTree(result);
|
||||
|
||||
auto fileList = fileTree->GetFileList();
|
||||
std::uint64_t total = std::accumulate(std::next(fileList.begin()), fileList.end(), fileList[0]->GetFileSize(), [](const std::uint64_t& sz, const CSiaFilePtr& file)
|
||||
if (fileList.size())
|
||||
{
|
||||
return sz + file->GetFileSize();
|
||||
});
|
||||
std::uint64_t total = std::accumulate(std::next(fileList.begin()), fileList.end(), fileList[0]->GetFileSize(), [](const std::uint64_t& sz, const CSiaFilePtr& file)
|
||||
{
|
||||
return sz + file->GetFileSize();
|
||||
});
|
||||
|
||||
std::uint32_t totalProgress = std::accumulate(std::next(fileList.begin()), fileList.end(), fileList[0]->GetUploadProgress(), [](const std::uint32_t& progress, const CSiaFilePtr& file)
|
||||
std::uint32_t totalProgress = std::accumulate(std::next(fileList.begin()), fileList.end(), fileList[0]->GetUploadProgress(), [](const std::uint32_t& progress, const CSiaFilePtr& file)
|
||||
{
|
||||
return progress + file->GetUploadProgress();
|
||||
}) / fileList.size();
|
||||
|
||||
SetTotalUsedBytes(total);
|
||||
SetTotalUploadProgress(totalProgress);
|
||||
}
|
||||
else
|
||||
{
|
||||
return progress + file->GetUploadProgress();
|
||||
}) / fileList.size();
|
||||
|
||||
SetTotalUsedBytes(total);
|
||||
SetTotalUploadProgress(totalProgress);
|
||||
SetTotalUsedBytes(0);
|
||||
SetTotalUploadProgress(100);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user