#1513 #865 Fixed the issue where we do not send the requests to Radarr/Sonarr when approving

Also fixed a landing page issue
This commit is contained in:
tidusjar 2017-09-23 23:38:18 +01:00
parent 0139a8f514
commit df1ab01e46
13 changed files with 134 additions and 37 deletions

View file

@ -141,6 +141,42 @@ namespace Ombi.Core.Engine
return results;
}
/// <summary>
/// This is the method that is triggered by pressing Approve on the requests page
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<RequestEngineResult> ApproveMovie(MovieRequests request)
{
if (request.Approved)
{
var result = await Sender.Send(request);
if (result.Success && result.MovieSent)
{
return new RequestEngineResult
{
RequestAdded = true
};
}
if (!result.Success)
{
Logger.LogWarning("Tried auto sending movie but failed. Message: {0}", result.Message);
return new RequestEngineResult
{
Message = result.Message,
ErrorMessage = result.Message,
RequestAdded = false
};
}
// If there are no providers then it's successful but movie has not been sent
}
return new RequestEngineResult
{
RequestAdded = true
};
}
/// <summary>
/// Updates the movie request.
/// </summary>