| 690 | } |
| 691 | |
| 692 | LocalAndRemoteSize Storage::CountrySizeInBytes(CountryId const & countryId) const |
| 693 | { |
| 694 | LocalFilePtr localFile = GetLatestLocalFile(countryId); |
| 695 | CountryFile const & countryFile = GetCountryFile(countryId); |
| 696 | LocalAndRemoteSize sizes(0, GetRemoteSize(countryFile)); |
| 697 | |
| 698 | if (!IsCountryInQueue(countryId) && !IsDiffApplyingInProgressToCountry(countryId)) |
| 699 | sizes.first = localFile ? localFile->GetSize(MapFileType::Map) : 0; |
| 700 | |
| 701 | auto const it = m_downloadingCountries.find(countryId); |
| 702 | if (it != m_downloadingCountries.cend()) |
| 703 | sizes.first = it->second.m_bytesDownloaded; |
| 704 | |
| 705 | return sizes; |
| 706 | } |
| 707 | |
| 708 | CountryFile const & Storage::GetCountryFile(CountryId const & countryId) const |
| 709 | { |