ItemsCollection on Container

This commit is contained in:
2023-02-27 09:00:30 +01:00
parent a01c3a69b4
commit ffbd7b154c
11 changed files with 26 additions and 103 deletions

View File

@@ -195,8 +195,7 @@ public class ItemManipulationUserCommandHandlerService : UserCommandHandlerServi
var resolvedOnlyItem = await _timelessContentProvider.GetItemByFullNameAsync(itemsToDelete[0], PointInTime.Present);
if (resolvedOnlyItem is IContainer {AllowRecursiveDeletion: true} onlyContainer
&& await onlyContainer.Items.GetItemsAsync() is { } children
&& children.Any())
&& onlyContainer.ItemsCollection.Any())
{
questionText = $"The container '{onlyContainer.DisplayName}' is not empty. Proceed with delete?";
}
@@ -206,7 +205,7 @@ public class ItemManipulationUserCommandHandlerService : UserCommandHandlerServi
}
}
if (itemsToDelete?.Count == 0) return;
if (itemsToDelete.Count == 0) return;
if (questionText is { })
{
@@ -219,7 +218,7 @@ public class ItemManipulationUserCommandHandlerService : UserCommandHandlerServi
return;
}
var deleteCommand = _serviceProvider.GetRequiredService<FileTime.Core.Command.Delete.DeleteCommand>();
deleteCommand.HardDelete = command.IsHardDelete;
deleteCommand.ItemsToDelete.AddRange(itemsToDelete!);

View File

@@ -80,8 +80,7 @@ public class SearchTask : ISearchTask
private async Task TraverseTree(IContainer container)
{
var items = (await container.Items.GetItemsAsync())?.ToList();
if (items is null) return;
var items = container.ItemsCollection.ToList();
var childContainers = new List<IContainer>();