Fix copy overwrites the source files sometimes

This commit is contained in:
2023-07-03 10:05:41 +02:00
parent 4f9e69f2ab
commit c29df77d39
7 changed files with 49 additions and 44 deletions

View File

@@ -110,7 +110,7 @@ public class CopyCommand : CommandBase, ITransportationCommand
{
var total = data.Sum(d => d.TotalProgress);
if (total == 0) return 0;
return (int) (data.Sum(d => d.Progress) * 100 / total);
return (int)(data.Sum(d => d.Progress) * 100 / total);
})
.Subscribe(SetTotalProgress);
@@ -140,10 +140,9 @@ public class CopyCommand : CommandBase, ITransportationCommand
TransportMode transportMode,
ICopyStrategy copyOperation)
{
var resolvedTarget = ((IContainer) await target.ResolveAsync()) ?? throw new Exception();
foreach (var source in sources)
{
var resolvedTarget = (IContainer)await target.ResolveAsync() ?? throw new Exception();
var item = await _timelessContentProvider.GetItemByFullNameAsync(source, currentTime);
if (item is IContainer container)