Add parameter to check live

This commit is contained in:
Victor Shcherb 2018-09-04 23:10:53 +02:00
parent 8ad8288865
commit c6f3f7afda

View file

@ -233,8 +233,14 @@ public class DownloadActivityType {
}
public String getBaseUrl(OsmandApplication ctx, String fileName) {
return "http://" + IndexConstants.INDEX_DOWNLOAD_DOMAIN + "/download?event=2&"
String url = "http://" + IndexConstants.INDEX_DOWNLOAD_DOMAIN + "/download?event=2&"
+ Version.getVersionAsURLParam(ctx) + "&file=" + encode(fileName);
if(this == LIVE_UPDATES_FILE && fileName.length() > 16) {
// DATE_AND_EXT_STR_LEN = "_18_06_02.obf.gz".length()
String region = fileName.substring(0, fileName.length() - 16).toLowerCase();
url += "&region" + encode(region);
}
return url;
}