Skip to content

Commit

Permalink
fix images in queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mlapaglia committed Nov 5, 2023
1 parent 3606ee4 commit 6ec8d09
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion OpenAlprWebhookProcessor/Alerts/AlertService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ private async Task ProcessAlertsAsync()
plateGroups = plateGroups.Where(x => x.Id == job.LicensePlateId);
}

var result = await plateGroups.FirstOrDefaultAsync(_cancellationTokenSource.Token);
var result = await plateGroups
.Include(x => x.PlateImage)
.FirstOrDefaultAsync(_cancellationTokenSource.Token);

if (result != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public TestPushoverClientRequestHandler(ProcessorContext processorContext,
public async Task HandleAsync(CancellationToken cancellationToken)
{
var testPlateGroup = await _processorContext.PlateGroups
.Include(x => x.PlateImage)
.Where(x => x.PlateImage != null)
.FirstOrDefaultAsync(cancellationToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ private async Task ProcessImageRequestsAsync()
var processorContext = scope.ServiceProvider.GetRequiredService<ProcessorContext>();

var plateGroups = await processorContext.PlateGroups
.Include(x => x.PlateImage)
.Include(x => x.VehicleImage)
.Where(x => x.OpenAlprUuid == job)
.ToListAsync(_cancellationTokenSource.Token);

Expand Down Expand Up @@ -158,6 +160,8 @@ private async Task ProcessImageCompressionRequestsAsync()
}

var plateGroups = await processorContext.PlateGroups
.Include(x => x.PlateImage)
.Include(x => x.VehicleImage)
.OrderBy(x => x.ReceivedOnEpoch)
.Where(x => x.ReceivedOnEpoch > lastReceivedOnEpoch)
.Where(x => !x.PlateImage.IsCompressed || !x.VehicleImage.IsCompressed)
Expand Down

0 comments on commit 6ec8d09

Please sign in to comment.