Add wiki and fix last modified date with new indexes

This commit is contained in:
Victor Shcherb 2012-01-18 23:13:18 +01:00
parent adfcaf7b88
commit 1bd67140ed
4 changed files with 14 additions and 9 deletions

View file

@ -17,6 +17,8 @@ public class IndexConstants {
public static final String POI_INDEX_EXT = ".poi.odb"; //$NON-NLS-1$ public static final String POI_INDEX_EXT = ".poi.odb"; //$NON-NLS-1$
public static final String BINARY_MAP_INDEX_EXT = ".obf"; //$NON-NLS-1$ public static final String BINARY_MAP_INDEX_EXT = ".obf"; //$NON-NLS-1$
public static final String GEN_LOG_INDEX_EXT = ".gen.log"; //$NON-NLS-1$
public static final String POI_INDEX_EXT_ZIP = ".poi.zip"; //$NON-NLS-1$ public static final String POI_INDEX_EXT_ZIP = ".poi.zip"; //$NON-NLS-1$
public static final String VOICE_INDEX_EXT_ZIP = ".voice.zip"; //$NON-NLS-1$ public static final String VOICE_INDEX_EXT_ZIP = ".voice.zip"; //$NON-NLS-1$
public static final String TTSVOICE_INDEX_EXT_ZIP = ".ttsvoice.zip"; //$NON-NLS-1$ public static final String TTSVOICE_INDEX_EXT_ZIP = ".ttsvoice.zip"; //$NON-NLS-1$

View file

@ -165,6 +165,9 @@ public class DownloadFileHelper {
while ((entry = zipIn.getNextEntry()) != null) { while ((entry = zipIn.getNextEntry()) != null) {
int size = (int)entry.getSize(); int size = (int)entry.getSize();
progress.startTask(ctx.getString(R.string.unzipping_file), size); progress.startTask(ctx.getString(R.string.unzipping_file), size);
if(entry.isDirectory() || entry.getName().endsWith(IndexConstants.GEN_LOG_INDEX_EXT)){
continue;
}
File fs; File fs;
if (!unzipToDir) { if (!unzipToDir) {
if (first) { if (first) {
@ -195,6 +198,10 @@ public class DownloadFileHelper {
progress.progress(read); progress.progress(read);
} }
out.close(); out.close();
if(dateModified != null){
fs.setLastModified(dateModified);
}
} }
zipIn.close(); zipIn.close();
fileToDownload.delete(); // zip is no needed more fileToDownload.delete(); // zip is no needed more
@ -202,20 +209,12 @@ public class DownloadFileHelper {
ArrayList<String> warnings = new ArrayList<String>(); ArrayList<String> warnings = new ArrayList<String>();
ResourceManager manager = ((OsmandApplication) ctx.getApplicationContext()).getResourceManager(); ResourceManager manager = ((OsmandApplication) ctx.getApplicationContext()).getResourceManager();
if(dateModified != null){
toIndex.setLastModified(dateModified);
}
if (toIndex.getName().endsWith(IndexConstants.POI_INDEX_EXT)) {
// update poi index immediately
manager.indexingPoi(progress, warnings, toIndex);
}
if(dateModified != null){ if(dateModified != null){
toIndex.setLastModified(dateModified); toIndex.setLastModified(dateModified);
manager.updateIndexLastDateModified(toIndex); manager.updateIndexLastDateModified(toIndex);
} }
toReIndex.add(toIndex); toReIndex.add(toIndex);
if (warnings.isEmpty()) { if (warnings.isEmpty()) {
showWarningCallback.showWarning(ctx.getString(R.string.download_index_success)); showWarningCallback.showWarning(ctx.getString(R.string.download_index_success));
} else { } else {
showWarningCallback.showWarning(warnings.get(0)); showWarningCallback.showWarning(warnings.get(0));

View file

@ -26,7 +26,7 @@ download sr Serbian;
download eo Esperanto; download eo Esperanto;
download ro Romanian; download ro Romanian;
download lt Lithuanian; download lt Lithuanian;
download fa Persian; download fa Farsi;
download cs Czech; download cs Czech;
download ms Malay; download ms Malay;
download zh Chinese; download zh Chinese;
@ -59,6 +59,7 @@ download ml Malayalam;
download als Alsatian; download als Alsatian;
download sw Swahili; download sw Swahili;
download ta Tamil; download ta Tamil;
download nds LowSaxon;
download ku Kurdish; download ku Kurdish;
download la Latin; download la Latin;
download ga Irish; download ga Irish;

View file

@ -98,6 +98,9 @@ function update_count_of_downloads($file) {
// Track page view // Track page view
$tracker->trackPageview($page, $session, $visitor); $tracker->trackPageview($page, $session, $visitor);
$event = new GoogleAnalytics\Event('Download '.$_SERVER['HTTP_USER_AGENT'], 'App', $file,1);
$tracker->trackEvent($event, $session, $visitor);
} }
set_time_limit(0); set_time_limit(0);
$xml = simplexml_load_file("indexes.xml"); $xml = simplexml_load_file("indexes.xml");