huge queue refactoring:

3 queues -> 1 queue
send delete validate updates
This commit is contained in:
Alex Bezdieniezhnykh
2025-05-17 19:25:33 +03:00
parent 87ceaa805b
commit d02550f5a0
20 changed files with 246 additions and 193 deletions
+7 -1
View File
@@ -30,7 +30,8 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="32"></RowDefinition>
<RowDefinition Height="18"></RowDefinition>
<RowDefinition Height="14"></RowDefinition>
</Grid.RowDefinitions>
<Image
Grid.Row="0"
@@ -42,6 +43,11 @@
Grid.Row="1"
Foreground="LightGray"
Text="{Binding ImageName}" />
<TextBlock
Grid.Row="2"
HorizontalAlignment="Right"
Foreground="Gray"
Text="{Binding CreatedEmail}" />
</Grid>
</Border>
</DataTemplate>
+2 -3
View File
@@ -273,10 +273,9 @@ public partial class DatasetExplorer
if (result != MessageBoxResult.Yes)
return;
var annotations = ThumbnailsView.SelectedItems.Cast<AnnotationThumbnail>().Select(x => x.Annotation)
.ToList();
var annotationNames = ThumbnailsView.SelectedItems.Cast<AnnotationThumbnail>().Select(x => x.Annotation.Name).ToList();
await _mediator.Publish(new AnnotationsDeletedEvent(annotations));
await _mediator.Publish(new AnnotationsDeletedEvent(annotationNames));
ThumbnailsView.SelectedIndex = Math.Min(SelectedAnnotations.Count, tempSelected);
}
@@ -99,7 +99,7 @@ public class DatasetExplorerEventHandler(
var annotations = datasetExplorer.ThumbnailsView.SelectedItems.Cast<AnnotationThumbnail>()
.Select(x => x.Annotation)
.ToList();
await annotationService.ValidateAnnotations(annotations, cancellationToken);
await annotationService.ValidateAnnotations(annotations.Select(x => x.Name).ToList(), token: cancellationToken);
foreach (var ann in datasetExplorer.SelectedAnnotations.Where(x => annotations.Contains(x.Annotation)))
{
ann.Annotation.AnnotationStatus = AnnotationStatus.Validated;
@@ -143,9 +143,8 @@ public class DatasetExplorerEventHandler(
public async Task Handle(AnnotationsDeletedEvent notification, CancellationToken cancellationToken)
{
var names = notification.Annotations.Select(x => x.Name).ToList();
var annThumbs = datasetExplorer.SelectedAnnotationDict
.Where(x => names.Contains(x.Key))
.Where(x => notification.AnnotationNames.Contains(x.Key))
.Select(x => x.Value)
.ToList();
foreach (var annThumb in annThumbs)