|
|
@ -72,7 +72,10 @@ namespace MediaBrowser.Providers.MediaInfo
|
|
|
|
// Try to translate to three character code
|
|
|
|
// Try to translate to three character code
|
|
|
|
// Be flexible and check against both the full and three character versions
|
|
|
|
// Be flexible and check against both the full and three character versions
|
|
|
|
var culture = _localization.GetCultures()
|
|
|
|
var culture = _localization.GetCultures()
|
|
|
|
.FirstOrDefault(i => string.Equals(i.DisplayName, language, StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, language, StringComparison.OrdinalIgnoreCase) || string.Equals(i.ThreeLetterISOLanguageName, language, StringComparison.OrdinalIgnoreCase) || string.Equals(i.TwoLetterISOLanguageName, language, StringComparison.OrdinalIgnoreCase));
|
|
|
|
.FirstOrDefault(i => string.Equals(i.DisplayName, language, StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
|
|
|
string.Equals(i.Name, language, StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
|
|
|
string.Equals(i.ThreeLetterISOLanguageName, language, StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
|
|
|
string.Equals(i.TwoLetterISOLanguageName, language, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
|
|
if (culture != null)
|
|
|
|
if (culture != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -99,10 +102,12 @@ namespace MediaBrowser.Providers.MediaInfo
|
|
|
|
private string NormalizeFilenameForSubtitleComparison(string filename)
|
|
|
|
private string NormalizeFilenameForSubtitleComparison(string filename)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Try to account for sloppy file naming
|
|
|
|
// Try to account for sloppy file naming
|
|
|
|
filename = filename.Replace("-", string.Empty);
|
|
|
|
|
|
|
|
filename = filename.Replace("_", string.Empty);
|
|
|
|
filename = filename.Replace("_", string.Empty);
|
|
|
|
filename = filename.Replace(" ", string.Empty);
|
|
|
|
filename = filename.Replace(" ", string.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// can't normalize this due to languages such as pt-br
|
|
|
|
|
|
|
|
//filename = filename.Replace("-", string.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
//filename = filename.Replace(".", string.Empty);
|
|
|
|
//filename = filename.Replace(".", string.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
return filename;
|
|
|
|
return filename;
|
|
|
|