diff --git a/src/ByteSync.Client/Assets/Resources/Resources.fr.resx b/src/ByteSync.Client/Assets/Resources/Resources.fr.resx index 1f53c5f1d..bb2186922 100644 --- a/src/ByteSync.Client/Assets/Resources/Resources.fr.resx +++ b/src/ByteSync.Client/Assets/Resources/Resources.fr.resx @@ -397,6 +397,9 @@ Voulez-vous continuer ? Erreurs d'identification : + + Entrées ignorées : + Démarrage : @@ -670,6 +673,9 @@ Voulez-vous continuer ? Total des erreurs de calcul : + + Total des entrées ignorées : + Total erreurs d'identification : diff --git a/src/ByteSync.Client/Assets/Resources/Resources.resx b/src/ByteSync.Client/Assets/Resources/Resources.resx index 395492cad..69dc16029 100644 --- a/src/ByteSync.Client/Assets/Resources/Resources.resx +++ b/src/ByteSync.Client/Assets/Resources/Resources.resx @@ -397,6 +397,9 @@ Would you like to continue ? Identification Errors: + + Skipped Entries: + Start: @@ -679,6 +682,9 @@ Would you like to continue ? Total Calculation Errors: + + Total Skipped Entries: + Total Identification Errors: diff --git a/src/ByteSync.Client/Business/Inventories/InventoryMonitorData.cs b/src/ByteSync.Client/Business/Inventories/InventoryMonitorData.cs index 7224fe229..88cdc0d9f 100644 --- a/src/ByteSync.Client/Business/Inventories/InventoryMonitorData.cs +++ b/src/ByteSync.Client/Business/Inventories/InventoryMonitorData.cs @@ -23,6 +23,8 @@ public record InventoryMonitorData public long UploadTotalVolume { get; set; } public long UploadedVolume { get; set; } + + public int SkippedEntriesCount { get; set; } public bool HasNonZeroProperty() { @@ -36,6 +38,7 @@ public bool HasNonZeroProperty() || AnalyzableVolume != 0 || IdentifiedVolume != 0 || UploadTotalVolume != 0 - || UploadedVolume != 0; + || UploadedVolume != 0 + || SkippedEntriesCount != 0; } } diff --git a/src/ByteSync.Client/Business/Inventories/InventoryProcessData.cs b/src/ByteSync.Client/Business/Inventories/InventoryProcessData.cs index db3317777..7ffdf0a0a 100644 --- a/src/ByteSync.Client/Business/Inventories/InventoryProcessData.cs +++ b/src/ByteSync.Client/Business/Inventories/InventoryProcessData.cs @@ -147,6 +147,7 @@ public void RecordSkippedEntry(SkippedEntry entry) _skippedEntries.Enqueue(entry); _skippedCountsByReason.AddOrUpdate(entry.Reason, 1, (_, currentCount) => currentCount + 1); Interlocked.Increment(ref _skippedCount); + UpdateMonitorData(m => { m.SkippedEntriesCount += 1; }); } // should be used during issue 268 implementation @@ -182,4 +183,4 @@ private void ClearSkippedEntries() _skippedCountsByReason.Clear(); Interlocked.Exchange(ref _skippedCount, 0); } -} \ No newline at end of file +} diff --git a/src/ByteSync.Client/Business/Inventories/InventoryStatistics.cs b/src/ByteSync.Client/Business/Inventories/InventoryStatistics.cs index 673158891..dcc0a69d0 100644 --- a/src/ByteSync.Client/Business/Inventories/InventoryStatistics.cs +++ b/src/ByteSync.Client/Business/Inventories/InventoryStatistics.cs @@ -11,4 +11,6 @@ public record InventoryStatistics public int AnalyzeErrors { get; init; } public int IdentificationErrors { get; init; } + + public int TotalSkippedEntries { get; init; } } diff --git a/src/ByteSync.Client/Services/Inventories/InventoryStatisticsService.cs b/src/ByteSync.Client/Services/Inventories/InventoryStatisticsService.cs index bf6c58e46..271a4aae9 100644 --- a/src/ByteSync.Client/Services/Inventories/InventoryStatisticsService.cs +++ b/src/ByteSync.Client/Services/Inventories/InventoryStatisticsService.cs @@ -66,7 +66,8 @@ private void DoCompute() ProcessedVolume = statsCollector.ProcessedSize, AnalyzeSuccess = statsCollector.Success, AnalyzeErrors = statsCollector.Errors, - IdentificationErrors = statsCollector.IdentificationErrors + IdentificationErrors = statsCollector.IdentificationErrors, + TotalSkippedEntries = statsCollector.TotalSkippedEntries }; _statisticsSubject.OnNext(stats); @@ -81,6 +82,8 @@ private void ProcessInventoryFile(InventoryFile inventoryFile, StatisticsCollect foreach (var part in inventory.InventoryParts) { + collector.TotalSkippedEntries += part.SkippedCount; + foreach (var dir in part.DirectoryDescriptions) { if (!dir.IsAccessible) @@ -142,6 +145,8 @@ private class StatisticsCollector public int Errors { get; set; } public int IdentificationErrors { get; set; } + + public int TotalSkippedEntries { get; set; } public long ProcessedSize { get; set; } } diff --git a/src/ByteSync.Client/ViewModels/Sessions/Inventories/InventoryGlobalStatusViewModel.cs b/src/ByteSync.Client/ViewModels/Sessions/Inventories/InventoryGlobalStatusViewModel.cs index 3a6a72d6f..eea8f3fc0 100644 --- a/src/ByteSync.Client/ViewModels/Sessions/Inventories/InventoryGlobalStatusViewModel.cs +++ b/src/ByteSync.Client/ViewModels/Sessions/Inventories/InventoryGlobalStatusViewModel.cs @@ -79,10 +79,15 @@ public InventoryGlobalStatusViewModel(IInventoryService inventoryService, ISessi [Reactive] public int? GlobalIdentificationErrors { get; set; } + + [Reactive] + public int? GlobalSkippedEntries { get; set; } public extern bool HasErrors { [ObservableAsProperty] get; } public extern bool HasIdentificationErrors { [ObservableAsProperty] get; } + + public extern bool ShowGlobalSkippedEntries { [ObservableAsProperty] get; } [Reactive] public string GlobalMainIcon { get; set; } = "None"; @@ -112,6 +117,11 @@ private void SetupBasicProperties(CompositeDisposable disposables) .Select(e => (e ?? 0) > 0) .ToPropertyEx(this, x => x.HasIdentificationErrors) .DisposeWith(disposables); + + this.WhenAnyValue(x => x.GlobalSkippedEntries) + .Select(e => (e ?? 0) > 0) + .ToPropertyEx(this, x => x.ShowGlobalSkippedEntries) + .DisposeWith(disposables); } private ReactiveStreams CreateStreams(IInventoryStatisticsService inventoryStatisticsService, CompositeDisposable disposables) @@ -270,6 +280,7 @@ private void UpdateStatisticsValues(InventoryStatistics? stats) GlobalAnalyzeSuccess = stats?.AnalyzeSuccess; GlobalAnalyzeErrors = stats?.AnalyzeErrors; GlobalIdentificationErrors = stats?.IdentificationErrors; + GlobalSkippedEntries = stats?.TotalSkippedEntries; } private void ApplySuccessState(int? errors, int? identificationErrors = null) @@ -332,6 +343,7 @@ private void ResetStatistics() GlobalAnalyzeSuccess = null; GlobalAnalyzeErrors = null; GlobalIdentificationErrors = null; + GlobalSkippedEntries = null; GlobalMainIcon = "None"; GlobalMainStatusText = string.Empty; GlobalMainIconBrush = null; diff --git a/src/ByteSync.Client/ViewModels/Sessions/Inventories/InventoryLocalIdentificationViewModel.cs b/src/ByteSync.Client/ViewModels/Sessions/Inventories/InventoryLocalIdentificationViewModel.cs index bebb7a953..2d9a0490f 100644 --- a/src/ByteSync.Client/ViewModels/Sessions/Inventories/InventoryLocalIdentificationViewModel.cs +++ b/src/ByteSync.Client/ViewModels/Sessions/Inventories/InventoryLocalIdentificationViewModel.cs @@ -52,6 +52,7 @@ private void HandleActivation(CompositeDisposable disposables) IdentifiedDirectories = m.IdentifiedDirectories; IdentifiedVolume = m.IdentifiedVolume; IdentificationErrors = m.IdentificationErrors; + SkippedEntriesCount = m.SkippedEntriesCount; }) .DisposeWith(disposables); @@ -59,6 +60,11 @@ private void HandleActivation(CompositeDisposable disposables) .Select(v => v > 0) .ToPropertyEx(this, x => x.HasIdentificationErrors) .DisposeWith(disposables); + + this.WhenAnyValue(x => x.SkippedEntriesCount) + .Select(v => v > 0) + .ToPropertyEx(this, x => x.ShowSkippedEntriesCount) + .DisposeWith(disposables); _inventoryService.InventoryProcessData.IdentificationStatus .ObserveOn(RxApp.MainThreadScheduler) @@ -133,8 +139,13 @@ private void HandleActivation(CompositeDisposable disposables) [Reactive] public int IdentificationErrors { get; set; } - + public extern bool HasIdentificationErrors { [ObservableAsProperty] get; } + + [Reactive] + public int SkippedEntriesCount { get; set; } + + public extern bool ShowSkippedEntriesCount { [ObservableAsProperty] get; } [Reactive] public string IdentificationIcon { get; set; } = "None"; diff --git a/src/ByteSync.Client/Views/Sessions/Inventories/InventoryGlobalStatusView.axaml b/src/ByteSync.Client/Views/Sessions/Inventories/InventoryGlobalStatusView.axaml index b3b428de2..cadf3c2d0 100644 --- a/src/ByteSync.Client/Views/Sessions/Inventories/InventoryGlobalStatusView.axaml +++ b/src/ByteSync.Client/Views/Sessions/Inventories/InventoryGlobalStatusView.axaml @@ -57,6 +57,7 @@ +