diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2017-09-07 12:23:22 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2017-09-13 16:25:52 +0300 |
commit | 8dc46e89b2292e605b71c7fa82ad4d87d8f5e391 (patch) | |
tree | 41269ff669fe184ed262641297fdebb00307b63f /storage | |
parent | 7da8824291f0ce39ed61268e29eb8133d6bf9340 (diff) |
Fixed android obb download.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/storage.cpp | 18 | ||||
-rw-r--r-- | storage/storage.hpp | 3 |
2 files changed, 10 insertions, 11 deletions
diff --git a/storage/storage.cpp b/storage/storage.cpp index d862e4df3a..10247ebdd7 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -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. diff --git a/storage/storage.hpp b/storage/storage.hpp index c1beaa2eee..527e083fb0 100644 --- a/storage/storage.hpp +++ b/storage/storage.hpp @@ -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; |