fixes #1349 - Problem with Greek subtitle download

This commit is contained in:
Luke 2015-12-24 02:15:39 -05:00 committed by Luke Pulverenti
parent 2e2929c77f
commit cc315c573c

View File

@ -222,6 +222,17 @@ namespace MediaBrowser.Providers.Subtitles
}); });
} }
private string NormalizeLanguage(string language)
{
// Problem with Greek subtitle download #1349
if (string.Equals (language, "gre", StringComparison.OrdinalIgnoreCase)) {
return "ell";
}
return language;
}
public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
{ {
var imdbIdText = request.GetProviderId(MetadataProviders.Imdb); var imdbIdText = request.GetProviderId(MetadataProviders.Imdb);
@ -258,7 +269,7 @@ namespace MediaBrowser.Providers.Subtitles
await Login(cancellationToken).ConfigureAwait(false); await Login(cancellationToken).ConfigureAwait(false);
var subLanguageId = request.Language; var subLanguageId = NormalizeLanguage(request.Language);
var hash = Utilities.ComputeHash(request.MediaPath); var hash = Utilities.ComputeHash(request.MediaPath);
var fileInfo = new FileInfo(request.MediaPath); var fileInfo = new FileInfo(request.MediaPath);
var movieByteSize = fileInfo.Length; var movieByteSize = fileInfo.Length;