Merge pull request #814 from lalmanzar/master

handle empty fields result
pull/702/head
Luke 11 years ago
commit 4e710ec0a4

@ -235,8 +235,10 @@ namespace MediaBrowser.Providers.Subtitles
Predicate<SubtitleSearchResult> mediaFilter =
x =>
request.ContentType == SubtitleMediaType.Episode
? int.Parse(x.SeriesSeason, _usCulture) == request.ParentIndexNumber && int.Parse(x.SeriesEpisode, _usCulture) == request.IndexNumber
: long.Parse(x.IDMovieImdb, _usCulture) == imdbId;
? !string.IsNullOrEmpty(x.SeriesSeason) && !string.IsNullOrEmpty(x.SeriesEpisode) &&
int.Parse(x.SeriesSeason, _usCulture) == request.ParentIndexNumber &&
int.Parse(x.SeriesEpisode, _usCulture) == request.IndexNumber
: !string.IsNullOrEmpty(x.IDMovieImdb) && long.Parse(x.IDMovieImdb, _usCulture) == imdbId;
var results = ((MethodResponseSubtitleSearch)result).Results;

Loading…
Cancel
Save