forked from organicmaps/organicmaps-tmp
Fixed android obb download.
This commit is contained in:
parent
7da8824291
commit
8dc46e89b2
3 changed files with 11 additions and 12 deletions
|
@ -189,7 +189,7 @@ extern "C"
|
|||
storage::Storage const & storage = g_framework->GetStorage();
|
||||
for (size_t i = 0; i < curFile.m_urls.size(); ++i)
|
||||
{
|
||||
curFile.m_urls[i] = storage.GetFileDownloadUrl(curFile.m_urls[i], curFile.m_fileName, MapOptions::Map);
|
||||
curFile.m_urls[i] = storage.GetFileDownloadUrl(curFile.m_urls[i], curFile.m_fileName);
|
||||
LOG(LDEBUG, (curFile.m_urls[i]));
|
||||
}
|
||||
|
||||
|
|
|
@ -925,17 +925,11 @@ void Storage::OnMapDownloadFinished(TCountryId const & countryId, bool success,
|
|||
string Storage::GetFileDownloadUrl(string const & baseUrl,
|
||||
QueuedCountry const & queuedCountry) const
|
||||
{
|
||||
return GetFileDownloadUrl(baseUrl, queuedCountry.GetCountryId(),
|
||||
queuedCountry.GetCurrentFileOptions());
|
||||
}
|
||||
|
||||
string Storage::GetFileDownloadUrl(string const & baseUrl, TCountryId const & countryId,
|
||||
MapOptions options) const
|
||||
{
|
||||
auto const & countryId = queuedCountry.GetCountryId();
|
||||
auto const options = queuedCountry.GetCurrentFileOptions();
|
||||
CountryFile const & countryFile = GetCountryFile(countryId);
|
||||
|
||||
string const fileName =
|
||||
GetFileName(countryFile.GetName(), options, GetCurrentDataVersion());
|
||||
string const fileName = GetFileName(countryFile.GetName(), options, GetCurrentDataVersion());
|
||||
|
||||
ostringstream url;
|
||||
url << baseUrl;
|
||||
|
@ -949,6 +943,12 @@ string Storage::GetFileDownloadUrl(string const & baseUrl, TCountryId const & co
|
|||
return url.str();
|
||||
}
|
||||
|
||||
string Storage::GetFileDownloadUrl(string const & baseUrl, string const & fileName) const
|
||||
{
|
||||
return baseUrl + OMIM_OS_NAME "/" + strings::to_string(GetCurrentDataVersion()) + "/" +
|
||||
UrlEncode(fileName);
|
||||
}
|
||||
|
||||
TCountryId Storage::FindCountryIdByFile(string const & name) const
|
||||
{
|
||||
// @TODO(bykoianko) Probably it's worth to check here if name represent a node in the tree.
|
||||
|
|
|
@ -536,8 +536,7 @@ public:
|
|||
void EnableKeepDownloadingQueue(bool enable) {m_keepDownloadingQueue = enable;}
|
||||
/// get download url by base url & queued country
|
||||
string GetFileDownloadUrl(string const & baseUrl, QueuedCountry const & queuedCountry) const;
|
||||
string GetFileDownloadUrl(string const & baseUrl, TCountryId const & countryId,
|
||||
MapOptions options) const;
|
||||
string GetFileDownloadUrl(string const & baseUrl, string const & fileName) const;
|
||||
|
||||
/// @param[out] res Populated with oudated countries.
|
||||
void GetOutdatedCountries(vector<Country const *> & countries) const;
|
||||
|
|
Loading…
Add table
Reference in a new issue