mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-10 11:25:04 -05:00
Prefer Locale.ENGLISH when it makes sense
This commit is contained in:
parent
331f51caf7
commit
9e87c59b68
@ -117,7 +117,7 @@ public class MediaDetection {
|
||||
|
||||
private static final SeasonEpisodeMatcher seasonEpisodeMatcherStrict = new SmartSeasonEpisodeMatcher(true);
|
||||
private static final SeasonEpisodeMatcher seasonEpisodeMatcherNonStrict = new SmartSeasonEpisodeMatcher(false);
|
||||
private static final DateMatcher dateMatcher = new DateMatcher(Locale.ROOT, DateMatcher.DEFAULT_SANITY);
|
||||
private static final DateMatcher dateMatcher = new DateMatcher(Locale.getDefault(), DateMatcher.DEFAULT_SANITY);
|
||||
|
||||
public static SeasonEpisodeMatcher getSeasonEpisodeMatcher(boolean strict) {
|
||||
return strict ? seasonEpisodeMatcherStrict : seasonEpisodeMatcherNonStrict;
|
||||
|
@ -576,12 +576,11 @@ public class ReleaseInfo {
|
||||
|
||||
public Map<String, Locale> getLanguageMap(Locale... supportedDisplayLocale) {
|
||||
// use maximum strength collator by default
|
||||
Collator collator = Collator.getInstance(Locale.ROOT);
|
||||
Collator collator = Collator.getInstance(Locale.ENGLISH);
|
||||
collator.setDecomposition(Collator.FULL_DECOMPOSITION);
|
||||
collator.setStrength(Collator.PRIMARY);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Comparator<String> order = (Comparator) collator;
|
||||
Comparator<? super String> order = collator;
|
||||
Map<String, Locale> languageMap = new TreeMap<String, Locale>(order);
|
||||
|
||||
for (String code : Locale.getISOLanguages()) {
|
||||
|
@ -303,7 +303,7 @@ public enum EpisodeMetrics implements SimilarityMetric {
|
||||
// Match by generic name similarity (absolute)
|
||||
SeriesName(new NameSimilarityMetric() {
|
||||
|
||||
private SeriesNameMatcher seriesNameMatcher = new SeriesNameMatcher(Locale.ROOT, false);
|
||||
private SeriesNameMatcher seriesNameMatcher = new SeriesNameMatcher(Locale.ENGLISH, false);
|
||||
|
||||
@Override
|
||||
public float getSimilarity(Object o1, Object o2) {
|
||||
|
@ -15,7 +15,7 @@ public class SequenceMatchSimilarity implements SimilarityMetric {
|
||||
}
|
||||
|
||||
public SequenceMatchSimilarity(int commonSequenceMaxStartIndex, boolean returnFirstMatch) {
|
||||
this.commonSequenceMatcher = new CommonSequenceMatcher(getLenientCollator(Locale.ROOT), commonSequenceMaxStartIndex, returnFirstMatch);
|
||||
this.commonSequenceMatcher = new CommonSequenceMatcher(getLenientCollator(Locale.ENGLISH), commonSequenceMaxStartIndex, returnFirstMatch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,7 +38,7 @@ public class SeriesNameMatcher {
|
||||
protected CommonSequenceMatcher commonSequenceMatcher;
|
||||
|
||||
public SeriesNameMatcher() {
|
||||
this(Locale.ROOT, true);
|
||||
this(Locale.ENGLISH, true);
|
||||
}
|
||||
|
||||
public SeriesNameMatcher(Locale locale, boolean strict) {
|
||||
|
@ -180,8 +180,8 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
|
||||
List<Callable<List<Match<File, ?>>>> tasks = new ArrayList<Callable<List<Match<File, ?>>>>();
|
||||
|
||||
// remember user decisions and only bother user once
|
||||
final Map<String, SearchResult> selectionMemory = new TreeMap<String, SearchResult>(CommonSequenceMatcher.getLenientCollator(Locale.ROOT));
|
||||
final Map<String, List<String>> inputMemory = new TreeMap<String, List<String>>(CommonSequenceMatcher.getLenientCollator(Locale.ROOT));
|
||||
final Map<String, SearchResult> selectionMemory = new TreeMap<String, SearchResult>(CommonSequenceMatcher.getLenientCollator(Locale.ENGLISH));
|
||||
final Map<String, List<String>> inputMemory = new TreeMap<String, List<String>>(CommonSequenceMatcher.getLenientCollator(Locale.ENGLISH));
|
||||
|
||||
// detect series names and create episode list fetch tasks
|
||||
if (strict) {
|
||||
|
Loading…
Reference in New Issue
Block a user