Merge pull request #9353 from osmandapp/auto_update_voices
compare by date preferred then size
This commit is contained in:
commit
f87138af63
2 changed files with 9 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,8 +202,11 @@ public class IndexItem implements Comparable<IndexItem> {
|
|||
public void setLocalTimestamp(long localTimestamp) {
|
||||
this.localTimestamp = localTimestamp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public long getLocalTimestamp() {
|
||||
return localTimestamp;
|
||||
}
|
||||
|
||||
public boolean isDownloaded() {
|
||||
return downloaded;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue