Skip to content

Commit

Permalink
Fix extraction progress calculation for the UFS/UFS2 file system imag…
Browse files Browse the repository at this point in the history
…e readonly support for NanaZip.Codecs.
  • Loading branch information
MouriNaruto committed Jan 31, 2025
1 parent 7e3ad90 commit 26ebb07
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions NanaZip.Codecs/NanaZip.Codecs.Archive.Ufs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,15 @@ namespace NanaZip::Codecs::Archive
NumItems = static_cast<UINT32>(this->m_FilePaths.size());
}

ExtractCallback->SetTotal(
this->GetTotalBlocks() * this->GetFragmentBlockSize());
UINT64 TotalSize = 0;
for (UINT32 i = 0; i < NumItems; ++i)
{
UINT32 ActualFileIndex = AllFilesMode ? i : Indices[i];
UfsInodeInformation& Information =
this->m_FilePaths[ActualFileIndex].Information;
TotalSize += Information.FileSize;
}
ExtractCallback->SetTotal(TotalSize);

UINT64 Completed = 0;

Expand Down

0 comments on commit 26ebb07

Please sign in to comment.