From 63d7596e9800b4332ebb988259fda6e6347173fe Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Tue, 11 Apr 2017 12:15:52 +0200 Subject: [PATCH] Catching predb.me errors hopefully. --- .../MetadataSource/PreDB/PreDBService.cs | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/NzbDrone.Core/MetadataSource/PreDB/PreDBService.cs b/src/NzbDrone.Core/MetadataSource/PreDB/PreDBService.cs index 8d4d2a1a2..38786ba1c 100644 --- a/src/NzbDrone.Core/MetadataSource/PreDB/PreDBService.cs +++ b/src/NzbDrone.Core/MetadataSource/PreDB/PreDBService.cs @@ -171,10 +171,12 @@ namespace NzbDrone.Core.MetadataSource.PreDB public bool HasReleases(Movie movie) { - var results = GetResults("movies", movie.Title); + try + { + var results = GetResults("movies", movie.Title); - foreach (PreDBResult result in results) - { + foreach (PreDBResult result in results) + { var parsed = Parser.Parser.ParseMovieTitle(result.Title); if (parsed == null) { @@ -182,13 +184,20 @@ namespace NzbDrone.Core.MetadataSource.PreDB } var match = _parsingService.Map(parsed, "", new MovieSearchCriteria { Movie = movie }); - if (match != null && match.Movie != null && match.Movie.Id == movie.Id) - { - return true; - } - } + if (match != null && match.Movie != null && match.Movie.Id == movie.Id) + { + return true; + } + } - return false; + return false; + } + catch (Exception ex) + { + _logger.Warn(ex, "Error while looking on predb.me."); + return false; + } + } } }