mirror of
https://github.com/Radarr/Radarr
synced 2024-12-26 01:38:24 +00:00
Exceptions when checking SAB's queue are now caught.
This commit is contained in:
parent
c0d1d2c502
commit
aec59de6b6
1 changed files with 24 additions and 15 deletions
|
@ -46,26 +46,35 @@ private static string GetNzbName(string urlString)
|
||||||
|
|
||||||
public virtual bool IsInQueue(EpisodeParseResult newParseResult)
|
public virtual bool IsInQueue(EpisodeParseResult newParseResult)
|
||||||
{
|
{
|
||||||
var queue = GetQueue().Where(c => c.ParseResult != null);
|
try
|
||||||
|
|
||||||
var matchigTitle = queue.Where(q => String.Equals(q.ParseResult.CleanTitle, newParseResult.Series.CleanTitle, StringComparison.InvariantCultureIgnoreCase));
|
|
||||||
|
|
||||||
var matchingTitleWithQuality = matchigTitle.Where(q => q.ParseResult.Quality >= newParseResult.Quality);
|
|
||||||
|
|
||||||
|
|
||||||
if (newParseResult.Series.IsDaily)
|
|
||||||
{
|
{
|
||||||
return matchingTitleWithQuality.Any(q => q.ParseResult.AirDate.Value.Date == newParseResult.AirDate.Value.Date);
|
var queue = GetQueue().Where(c => c.ParseResult != null);
|
||||||
|
|
||||||
|
var matchigTitle = queue.Where(q => String.Equals(q.ParseResult.CleanTitle, newParseResult.Series.CleanTitle, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
|
var matchingTitleWithQuality = matchigTitle.Where(q => q.ParseResult.Quality >= newParseResult.Quality);
|
||||||
|
|
||||||
|
|
||||||
|
if (newParseResult.Series.IsDaily)
|
||||||
|
{
|
||||||
|
return matchingTitleWithQuality.Any(q => q.ParseResult.AirDate.Value.Date == newParseResult.AirDate.Value.Date);
|
||||||
|
}
|
||||||
|
|
||||||
|
var matchingSeason = matchingTitleWithQuality.Where(q => q.ParseResult.SeasonNumber == newParseResult.SeasonNumber);
|
||||||
|
|
||||||
|
if (newParseResult.FullSeason)
|
||||||
|
{
|
||||||
|
return matchingSeason.Any();
|
||||||
|
}
|
||||||
|
|
||||||
|
return matchingSeason.Any(q => q.ParseResult.EpisodeNumbers != null && q.ParseResult.EpisodeNumbers.Any(e => newParseResult.EpisodeNumbers.Contains(e)));
|
||||||
}
|
}
|
||||||
|
|
||||||
var matchingSeason = matchingTitleWithQuality.Where(q => q.ParseResult.SeasonNumber == newParseResult.SeasonNumber);
|
catch (Exception ex)
|
||||||
|
|
||||||
if (newParseResult.FullSeason)
|
|
||||||
{
|
{
|
||||||
return matchingSeason.Any();
|
logger.WarnException("Unable to connect to SABnzbd to check queue.", ex);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return matchingSeason.Any(q => q.ParseResult.EpisodeNumbers != null && q.ParseResult.EpisodeNumbers.Any(e => newParseResult.EpisodeNumbers.Contains(e)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool DownloadNzb(string url, string title)
|
public virtual bool DownloadNzb(string url, string title)
|
||||||
|
|
Loading…
Reference in a new issue