From 6ec8d097919ad28c09c38d59c462a9a6174a022f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Nov 2023 23:26:39 -0400 Subject: [PATCH] fix images in queries --- OpenAlprWebhookProcessor/Alerts/AlertService.cs | 4 +++- .../Alerts/Pushover/TestPushoverClientRequestHandler.cs | 1 + .../WebhookProcessor/ImageRetrieverService.cs | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenAlprWebhookProcessor/Alerts/AlertService.cs b/OpenAlprWebhookProcessor/Alerts/AlertService.cs index a56db0d5..d6e12804 100644 --- a/OpenAlprWebhookProcessor/Alerts/AlertService.cs +++ b/OpenAlprWebhookProcessor/Alerts/AlertService.cs @@ -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) { diff --git a/OpenAlprWebhookProcessor/Alerts/Pushover/TestPushoverClientRequestHandler.cs b/OpenAlprWebhookProcessor/Alerts/Pushover/TestPushoverClientRequestHandler.cs index 7e655603..8d498129 100644 --- a/OpenAlprWebhookProcessor/Alerts/Pushover/TestPushoverClientRequestHandler.cs +++ b/OpenAlprWebhookProcessor/Alerts/Pushover/TestPushoverClientRequestHandler.cs @@ -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); diff --git a/OpenAlprWebhookProcessor/WebhookProcessor/ImageRetrieverService.cs b/OpenAlprWebhookProcessor/WebhookProcessor/ImageRetrieverService.cs index 28fca5ff..7e2849ea 100644 --- a/OpenAlprWebhookProcessor/WebhookProcessor/ImageRetrieverService.cs +++ b/OpenAlprWebhookProcessor/WebhookProcessor/ImageRetrieverService.cs @@ -78,6 +78,8 @@ private async Task ProcessImageRequestsAsync() var processorContext = scope.ServiceProvider.GetRequiredService(); var plateGroups = await processorContext.PlateGroups + .Include(x => x.PlateImage) + .Include(x => x.VehicleImage) .Where(x => x.OpenAlprUuid == job) .ToListAsync(_cancellationTokenSource.Token); @@ -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)