mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 08:36:29 +00:00
don't send image to the queue on editing
This commit is contained in:
@@ -13,7 +13,7 @@ public class AnnotationMessage
|
||||
[Key(3)] public TimeSpan Time { get; set; }
|
||||
[Key(4)] public string ImageExtension { get; set; } = null!;
|
||||
[Key(5)] public string Detections { get; set; } = null!;
|
||||
[Key(6)] public byte[] Image { get; set; } = null!;
|
||||
[Key(6)] public byte[]? Image { get; set; } = null!;
|
||||
[Key(7)] public RoleEnum Role { get; set; }
|
||||
[Key(8)] public string Email { get; set; } = null!;
|
||||
[Key(9)] public SourceEnum Source { get; set; }
|
||||
|
||||
@@ -97,7 +97,7 @@ public class AnnotationService : IAnnotationService, INotificationHandler<Annota
|
||||
msg.Time,
|
||||
JsonConvert.DeserializeObject<List<Detection>>(msg.Detections) ?? [],
|
||||
msg.Source,
|
||||
new MemoryStream(msg.Image),
|
||||
msg.Image == null ? null : new MemoryStream(msg.Image),
|
||||
msg.Role,
|
||||
msg.Email,
|
||||
fromQueue: true,
|
||||
@@ -141,9 +141,8 @@ public class AnnotationService : IAnnotationService, INotificationHandler<Annota
|
||||
await SaveAnnotationInner(DateTime.UtcNow, originalMediaName, time, detections, SourceEnum.Manual, stream,
|
||||
_api.CurrentUser.Role, _api.CurrentUser.Email, token: token);
|
||||
|
||||
// Manual save from Validators -> Validated -> stream: azaion-annotations-confirm
|
||||
// AI, Manual save from Operators -> Created -> stream: azaion-annotations
|
||||
private async Task<Annotation> SaveAnnotationInner(DateTime createdDate, string originalMediaName, TimeSpan time, List<Detection> detections, SourceEnum source, Stream? stream,
|
||||
private async Task<Annotation> SaveAnnotationInner(DateTime createdDate, string originalMediaName, TimeSpan time,
|
||||
List<Detection> detections, SourceEnum source, Stream? stream,
|
||||
RoleEnum userRole,
|
||||
string createdEmail,
|
||||
bool fromQueue = false,
|
||||
|
||||
@@ -98,7 +98,10 @@ public class FailsafeAnnotationsProducer
|
||||
if (annotation == null)
|
||||
continue;
|
||||
|
||||
var image = await File.ReadAllBytesAsync(annotation.ImagePath, ct);
|
||||
var image = record.Operation == AnnotationStatus.Created
|
||||
? await File.ReadAllBytesAsync(annotation.ImagePath, ct)
|
||||
: null;
|
||||
|
||||
var annMessage = new AnnotationMessage
|
||||
{
|
||||
Name = annotation.Name,
|
||||
|
||||
Reference in New Issue
Block a user