From 87b2959ebb7ce3aa6fda070a62efd071e066ac3d Mon Sep 17 00:00:00 2001 From: ExMix Date: Tue, 14 Oct 2014 16:59:44 +0300 Subject: [PATCH] [core] return actual downloaded size of files that InDownloading state --- storage/storage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/storage/storage.cpp b/storage/storage.cpp index 9eda0356d3..7209d3d0f5 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -204,9 +204,13 @@ namespace storage return CountryByIndex(index).GetFile().GetFileWithoutExt(); } - LocalAndRemoteSizeT Storage::CountrySizeInBytes(const TIndex & index, TMapOptions opt) const + LocalAndRemoteSizeT Storage::CountrySizeInBytes(TIndex const & index, TMapOptions opt) const { - return QueuedCountry(*this, index, opt).GetFullSize(); + LocalAndRemoteSizeT sizes = QueuedCountry(*this, index, opt).GetFullSize(); + if (m_request != nullptr && m_queue.front().GetIndex() == index) + sizes.first = m_request->Progress().first + m_countryProgress.first; + + return sizes; } TStatus Storage::CountryStatus(TIndex const & index) const