mirror of
https://github.com/Radarr/Radarr
synced 2025-01-01 12:54:21 +00:00
Catching predb.me errors hopefully.
This commit is contained in:
parent
d33ec334f3
commit
63d7596e98
1 changed files with 18 additions and 9 deletions
|
@ -171,10 +171,12 @@ public void Execute(PreDBSyncCommand message)
|
||||||
|
|
||||||
public bool HasReleases(Movie movie)
|
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);
|
var parsed = Parser.Parser.ParseMovieTitle(result.Title);
|
||||||
if (parsed == null)
|
if (parsed == null)
|
||||||
{
|
{
|
||||||
|
@ -182,13 +184,20 @@ public bool HasReleases(Movie movie)
|
||||||
}
|
}
|
||||||
var match = _parsingService.Map(parsed, "", new MovieSearchCriteria { Movie = movie });
|
var match = _parsingService.Map(parsed, "", new MovieSearchCriteria { Movie = movie });
|
||||||
|
|
||||||
if (match != null && match.Movie != null && match.Movie.Id == movie.Id)
|
if (match != null && match.Movie != null && match.Movie.Id == movie.Id)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Warn(ex, "Error while looking on predb.me.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue