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

@@ -111,13 +111,12 @@ public class CopyCommand : CommandBase, ITransportationCommand
if (item is IContainer container)
{
if (!((await resolvedTarget.Items.GetItemsAsync())?.Any(i => i.Path.GetName() == item.Name) ?? false))
if (resolvedTarget.ItemsCollection.All(i => i.Path.GetName() != item.Name))
{
await copyOperation.CreateContainerAsync(resolvedTarget, container.Name, container.PointInTime);
}
var children = await container.Items.GetItemsAsync();
if (children is null) continue;
var children = container.ItemsCollection;
await TraverseTree(currentTime, children.Select(c => c.Path).ToList(), target.GetChild(item.Name, AbsolutePathType.Container), transportMode, copyOperation);
await copyOperation.ContainerCopyDoneAsync(new AbsolutePath(_timelessContentProvider, container));