mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-25 01:08:52 -05:00
* fine-tune query clean-up => improved movie matching
This commit is contained in:
parent
ea9cc3bca7
commit
ee9d14651d
@ -69,7 +69,7 @@ public class ReleaseInfo {
|
|||||||
// match locale identifier and lookup Locale object
|
// match locale identifier and lookup Locale object
|
||||||
Map<String, Locale> languages = getLanguageMap(Locale.ENGLISH, Locale.getDefault());
|
Map<String, Locale> languages = getLanguageMap(Locale.ENGLISH, Locale.getDefault());
|
||||||
|
|
||||||
String lang = matchLast(getLanguageSuffixPattern(languages.keySet()), null, name);
|
String lang = matchLast(getLanguageSuffixPattern(languages.keySet(), false), null, name);
|
||||||
if (lang == null)
|
if (lang == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ public class ReleaseInfo {
|
|||||||
Set<String> languages = getLanguageMap(Locale.ENGLISH, Locale.getDefault()).keySet();
|
Set<String> languages = getLanguageMap(Locale.ENGLISH, Locale.getDefault()).keySet();
|
||||||
Pattern clutterBracket = getClutterBracketPattern(strict);
|
Pattern clutterBracket = getClutterBracketPattern(strict);
|
||||||
Pattern releaseGroup = getReleaseGroupPattern(strict);
|
Pattern releaseGroup = getReleaseGroupPattern(strict);
|
||||||
Pattern languageSuffix = getLanguageSuffixPattern(languages);
|
Pattern languageSuffix = getLanguageSuffixPattern(languages, strict);
|
||||||
Pattern languageTag = getLanguageTagPattern(languages);
|
Pattern languageTag = getLanguageTagPattern(languages);
|
||||||
Pattern videoSource = getVideoSourcePattern();
|
Pattern videoSource = getVideoSourcePattern();
|
||||||
Pattern videoFormat = getVideoFormatPattern();
|
Pattern videoFormat = getVideoFormatPattern();
|
||||||
@ -181,9 +181,9 @@ public class ReleaseInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Pattern getLanguageSuffixPattern(Collection<String> languages) {
|
public Pattern getLanguageSuffixPattern(Collection<String> languages, boolean strict) {
|
||||||
// .en.srt
|
// .en.srt
|
||||||
return compile("(?<=[\\p{Punct}\\p{Space}])(" + join(quoteAll(languages), "|") + ")(?=[._ ]*$)", CASE_INSENSITIVE | UNICODE_CASE);
|
return compile("(?<=" + (strict ? "[.]" : "[\\p{Punct}\\p{Space}]") + ")(" + join(quoteAll(languages), "|") + ")(?=[._ ]*$)", (strict ? 0 : CASE_INSENSITIVE) | UNICODE_CASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -422,7 +422,7 @@ public class ReleaseInfo {
|
|||||||
for (Locale language : new HashSet<Locale>(asList(supportedDisplayLocale))) {
|
for (Locale language : new HashSet<Locale>(asList(supportedDisplayLocale))) {
|
||||||
// make sure language name is properly normalized so accents and whatever don't break the regex pattern syntax
|
// make sure language name is properly normalized so accents and whatever don't break the regex pattern syntax
|
||||||
String languageName = Normalizer.normalize(locale.getDisplayLanguage(language), Form.NFKD);
|
String languageName = Normalizer.normalize(locale.getDisplayLanguage(language), Form.NFKD);
|
||||||
languageMap.put(languageName, locale);
|
languageMap.put(languageName.toLowerCase(), locale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,6 +343,7 @@ DCP
|
|||||||
DDC
|
DDC
|
||||||
dddc
|
dddc
|
||||||
DDR
|
DDR
|
||||||
|
DeadFish
|
||||||
DEAL
|
DEAL
|
||||||
DeBCz
|
DeBCz
|
||||||
DECADE
|
DECADE
|
||||||
@ -880,6 +881,7 @@ LTRG
|
|||||||
LTT
|
LTT
|
||||||
LTU
|
LTU
|
||||||
LU3UR
|
LU3UR
|
||||||
|
Lum1x
|
||||||
LUSO
|
LUSO
|
||||||
M794
|
M794
|
||||||
MACHD
|
MACHD
|
||||||
@ -1009,6 +1011,7 @@ NuMy
|
|||||||
NUXX
|
NUXX
|
||||||
NVA
|
NVA
|
||||||
NWO
|
NWO
|
||||||
|
NWTC
|
||||||
NYDIC
|
NYDIC
|
||||||
NyTT
|
NyTT
|
||||||
O2
|
O2
|
||||||
@ -1111,6 +1114,7 @@ PSYCHD
|
|||||||
PTBR
|
PTBR
|
||||||
Pti
|
Pti
|
||||||
PtP
|
PtP
|
||||||
|
PTpOWeR
|
||||||
PtS
|
PtS
|
||||||
Pudding
|
Pudding
|
||||||
PUKKA
|
PUKKA
|
||||||
|
Loading…
Reference in New Issue
Block a user