mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 03:28:28 -07:00
Added the ability to re-process requests
This commit is contained in:
parent
6c64f3d4a3
commit
264568f396
15 changed files with 115 additions and 6 deletions
|
@ -25,6 +25,7 @@ using Ombi.Settings.Settings.Models;
|
|||
using Ombi.Store.Entities.Requests;
|
||||
using Ombi.Store.Repository;
|
||||
using Ombi.Core.Models;
|
||||
using System.Threading;
|
||||
|
||||
namespace Ombi.Core.Engine
|
||||
{
|
||||
|
@ -896,6 +897,22 @@ namespace Ombi.Core.Engine
|
|||
}
|
||||
|
||||
|
||||
public async Task<RequestEngineResult> ReProcessRequest(int requestId, CancellationToken cancellationToken)
|
||||
{
|
||||
var request = await TvRepository.GetChild().FirstOrDefaultAsync(x => x.Id == requestId, cancellationToken);
|
||||
if (request == null)
|
||||
{
|
||||
return new RequestEngineResult
|
||||
{
|
||||
Result = false,
|
||||
ErrorMessage = "Request does not exist"
|
||||
};
|
||||
}
|
||||
|
||||
return await ProcessSendingShow(request);
|
||||
}
|
||||
|
||||
|
||||
private async Task<RequestEngineResult> AfterRequest(ChildRequests model, string requestOnBehalf)
|
||||
{
|
||||
var sendRuleResult = await RunSpecificRule(model, SpecificRules.CanSendNotification);
|
||||
|
@ -913,6 +930,11 @@ namespace Ombi.Core.Engine
|
|||
EpisodeCount = model.SeasonRequests.Select(m => m.Episodes.Count).Sum(),
|
||||
});
|
||||
|
||||
return await ProcessSendingShow(model);
|
||||
}
|
||||
|
||||
private async Task<RequestEngineResult> ProcessSendingShow(ChildRequests model)
|
||||
{
|
||||
if (model.Approved)
|
||||
{
|
||||
// Autosend
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue