Try to fix updates tts files issue.

This commit is contained in:
Denis 2014-12-04 14:43:26 +02:00
parent 434b876965
commit 9a342d2e72
4 changed files with 20 additions and 3 deletions

View file

@ -256,7 +256,7 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment {
} }
return files; return files;
} }
public static File findFileInDir(File file) { public static File findFileInDir(File file) {
if(file.isDirectory()) { if(file.isDirectory()) {
File[] lf = file.listFiles(); File[] lf = file.listFiles();

View file

@ -551,7 +551,17 @@ public class DownloadIndexesThread {
!date.equals(indexactivateddate) && !date.equals(indexactivateddate) &&
!date.equals(indexfilesdate) && !date.equals(indexfilesdate) &&
indexActivatedFileNames.containsKey(sfName)) { indexActivatedFileNames.containsKey(sfName)) {
itemsToUpdate.add(item); if (item.getType() == DownloadActivityType.NORMAL_FILE){
itemsToUpdate.add(item);
} else {
long itemSize = item.getSize();
File file = new File(((DownloadOsmandIndexesHelper.AssetIndexItem) item).getDestFile());
long oldItemSize = file.length();
if (itemSize != oldItemSize){
itemsToUpdate.add(item);
}
}
} }
} }
if (uiActivity != null){ if (uiActivity != null){

View file

@ -165,6 +165,10 @@ public class DownloadOsmandIndexesHelper {
res.add(new DownloadEntry(this, assetName, destFile, dateModified)); res.add(new DownloadEntry(this, assetName, destFile, dateModified));
return res; return res;
} }
public String getDestFile(){
return destFile;
}
} }

View file

@ -57,7 +57,10 @@ public class IndexItem implements Comparable<IndexItem> {
return timestamp; return timestamp;
} }
public long getSize(){
return containerSize;
}
public String getSizeDescription(Context ctx) { public String getSizeDescription(Context ctx) {
return size + " MB"; return size + " MB";
} }