mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Started on the queue for requests #483 TV Requests with missing information has been completed
This commit is contained in:
parent
5a5f7f5610
commit
50dec5f530
14 changed files with 276 additions and 71 deletions
|
@ -46,14 +46,14 @@ namespace PlexRequests.Core.Queue
|
|||
private IRepository<RequestQueue> RequestQueue { get; }
|
||||
|
||||
|
||||
public void QueueItem(RequestedModel request, RequestType type, FaultType faultType)
|
||||
public void QueueItem(RequestedModel request, string id, RequestType type, FaultType faultType)
|
||||
{
|
||||
//Ensure there is not a duplicate queued item
|
||||
var existingItem = RequestQueue.Custom(
|
||||
connection =>
|
||||
{
|
||||
connection.Open();
|
||||
var result = connection.Query<RequestQueue>("select * from RequestQueue where PrimaryIdentifier = @ProviderId", new { ProviderId = request.ProviderId });
|
||||
var result = connection.Query<RequestQueue>("select * from RequestQueue where PrimaryIdentifier = @ProviderId", new { ProviderId = id });
|
||||
|
||||
return result;
|
||||
}).FirstOrDefault();
|
||||
|
@ -68,19 +68,19 @@ namespace PlexRequests.Core.Queue
|
|||
{
|
||||
Type = type,
|
||||
Content = ByteConverterHelper.ReturnBytes(request),
|
||||
PrimaryIdentifier = request.ProviderId,
|
||||
PrimaryIdentifier = id,
|
||||
FaultType = faultType
|
||||
};
|
||||
RequestQueue.Insert(queue);
|
||||
}
|
||||
|
||||
public async Task QueueItemAsync(RequestedModel request, RequestType type, FaultType faultType)
|
||||
public async Task QueueItemAsync(RequestedModel request, string id, RequestType type, FaultType faultType)
|
||||
{
|
||||
//Ensure there is not a duplicate queued item
|
||||
var existingItem = await RequestQueue.CustomAsync(async connection =>
|
||||
{
|
||||
connection.Open();
|
||||
var result = await connection.QueryAsync<RequestQueue>("select * from RequestQueue where PrimaryIdentifier = @ProviderId", new { ProviderId = request.ProviderId });
|
||||
var result = await connection.QueryAsync<RequestQueue>("select * from RequestQueue where PrimaryIdentifier = @ProviderId", new { ProviderId = id });
|
||||
|
||||
return result;
|
||||
});
|
||||
|
@ -95,7 +95,7 @@ namespace PlexRequests.Core.Queue
|
|||
{
|
||||
Type = type,
|
||||
Content = ByteConverterHelper.ReturnBytes(request),
|
||||
PrimaryIdentifier = request.ProviderId,
|
||||
PrimaryIdentifier = id,
|
||||
FaultType = faultType
|
||||
};
|
||||
await RequestQueue.InsertAsync(queue);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue