If Radarr/Sonarr has noticed that the media is available, then mark it as available in the UI

This commit is contained in:
Jamie 2018-01-02 16:01:56 +00:00
parent 9d7a66b5fe
commit a8bb352c34
9 changed files with 954 additions and 13 deletions

View file

@ -25,6 +25,10 @@ namespace Ombi.Core.Rule.Rules.Search
if (result != null)
{
obj.Approved = true; // It's in radarr so it's approved... Maybe have a new property called "Processing" or something?
if (result.HasFile)
{
obj.Available = true;
}
}
}
return Task.FromResult(Success());

View file

@ -67,12 +67,16 @@ namespace Ombi.Core.Rule.Rules
foreach (var ep in season.Episodes)
{
// Check if we have it
var monitoredInSonarr = sonarrEpisodes.Any(x =>
var monitoredInSonarr = await sonarrEpisodes.FirstOrDefaultAsync(x =>
x.EpisodeNumber == ep.EpisodeNumber && x.SeasonNumber == season.SeasonNumber
&& x.TvDbId == vm.Id);
if (monitoredInSonarr)
if (monitoredInSonarr != null)
{
ep.Approved = true;
if (monitoredInSonarr.HasFile)
{
obj.Available = true;
}
}
}
}