update validation logic

This commit is contained in:
Alex Bezdieniezhnykh
2025-04-21 17:02:13 +03:00
parent 70148bdfdf
commit c68c293448
5 changed files with 43 additions and 19 deletions
@@ -2,6 +2,7 @@
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using Azaion.Common.Database;
using Azaion.Common.DTO;
using Azaion.Common.DTO.Queue;
using Azaion.Common.Events;
@@ -96,8 +97,14 @@ public class DatasetExplorerEventHandler(
var annotations = datasetExplorer.ThumbnailsView.SelectedItems.Cast<AnnotationThumbnail>()
.Select(x => x.Annotation)
.ToList();
foreach (var annotation in annotations)
await annotationService.ValidateAnnotation(annotation, cancellationToken);
await annotationService.ValidateAnnotations(annotations, cancellationToken);
foreach (var ann in datasetExplorer.SelectedAnnotations.Where(x => annotations.Contains(x.Annotation)))
{
ann.Annotation.AnnotationStatus = AnnotationStatus.Validated;
if (datasetExplorer.SelectedAnnotationDict.TryGetValue(ann.Annotation.Name, out var value))
value.Annotation.AnnotationStatus = AnnotationStatus.Validated;
ann.UpdateUI();
}
break;
}
}