Skip to content

Commit

Permalink
Don't bomb with missing make/model (#11)
Browse files Browse the repository at this point in the history
* don't bomb on missing makemodel

* this too
  • Loading branch information
mlapaglia committed Jan 3, 2021
1 parent b0684c5 commit 19002ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OpenAlprWebhookProcessor/WebhookProcessor/WebhookHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ public void Handle(OpenAlprWebhook webhook)
OpenAlprCameraId = webhook.CameraId,
OpenAlprProcessingTimeMs = Math.Round(webhook.BestPlate.ProcessingTimeMs, 2),
ProcessedPlateConfidence = Math.Round(webhook.BestPlate.Confidence, 2),
VehicleDescription = $"{webhook.Vehicle.Year[0]?.Name} {FormatVehicleDescription(webhook.Vehicle.MakeModel[0]?.Name)}",
};

if (webhook.Vehicle.MakeModel.Count > 0)
{
updateRequest.VehicleDescription = $"{webhook.Vehicle.Year[0].Name} {FormatVehicleDescription(webhook.Vehicle.MakeModel[0].Name)}";
}

_cameraUpdateService.AddJob(updateRequest);
}

Expand Down

0 comments on commit 19002ea

Please sign in to comment.