diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java index 0628aefae3..8a5b37fffb 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java @@ -187,10 +187,11 @@ public class DownloadResources extends DownloadResourceGroup { outdated = true; } } else { - long itemSize = item.getContentSize(); long oldItemSize = 0; - if (item.getType() == DownloadActivityType.VOICE_FILE) { + if (parsed && item.getTimestamp() > item.getLocalTimestamp()) { + outdated = true; + } else if (item.getType() == DownloadActivityType.VOICE_FILE) { if (item instanceof AssetIndexItem) { File file = new File(((AssetIndexItem) item).getDestFile()); oldItemSize = file.length(); @@ -213,7 +214,7 @@ public class DownloadResources extends DownloadResourceGroup { } else { oldItemSize = app.getAppPath(item.getTargetFileName()).length(); } - if (itemSize != oldItemSize) { + if (!parsed && itemSize != oldItemSize) { outdated = true; } } diff --git a/OsmAnd/src/net/osmand/plus/download/IndexItem.java b/OsmAnd/src/net/osmand/plus/download/IndexItem.java index 52c738faaa..7173dfca66 100644 --- a/OsmAnd/src/net/osmand/plus/download/IndexItem.java +++ b/OsmAnd/src/net/osmand/plus/download/IndexItem.java @@ -202,8 +202,11 @@ public class IndexItem implements Comparable { public void setLocalTimestamp(long localTimestamp) { this.localTimestamp = localTimestamp; } - - + + public long getLocalTimestamp() { + return localTimestamp; + } + public boolean isDownloaded() { return downloaded; }