travel constant fix

This commit is contained in:
simon 2020-12-09 16:29:59 +02:00
parent 6babf25c39
commit f31ad60d47
2 changed files with 2 additions and 4 deletions

View file

@ -1138,7 +1138,7 @@ public class ResourceManager {
Collection<BinaryMapReaderResource> fileReaders = getFileReaders();
List<BinaryMapIndexReader> readers = new ArrayList<>(fileReaders.size());
for (BinaryMapReaderResource res : fileReaders) {
if (!res.filename.toString().toLowerCase().contains("wiki")) {
if (!res.filename.toString().toLowerCase().contains("travel.obf")) {
continue;
}
BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI);

View file

@ -1,7 +1,6 @@
package net.osmand.plus.wikivoyage.data;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import net.osmand.Collator;
import net.osmand.CollatorStringMatcher;
@ -66,7 +65,7 @@ public class TravelObfHelper implements TravelHelper {
File[] files = app.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles();
if (files != null) {
for (File f : files) {
if (f.getName().equals(WIKIVOYAGE_OBF)) {
if (f.getName().equals(WIKIVOYAGE_OBF) || f.getName().contains("travel.obf")) {
return true;
}
}
@ -127,7 +126,6 @@ public class TravelObfHelper implements TravelHelper {
@NonNull
@Override
public List<WikivoyageSearchResult> search(String searchQuery) {
List<WikivoyageSearchResult> res = new ArrayList<>();
CollatorStringMatcher matcher = new CollatorStringMatcher(searchQuery,
CollatorStringMatcher.StringMatcherMode.CHECK_STARTS_FROM_SPACE);