merge: rc.14 parcel layout

This commit is contained in:
Alby96 committed 2026-11-06 17:14:07 +01:00
commit e97df55840
24 files changed
+605 -21

No files matched your search

@@ -1,5 +1,6 @@
using System.IO;
using Chronos.App.Archiving;
using Chronos.Core.Archiving;
using Chronos.Core.Diagnostics;
using Chronos.Data.Archiving;
@@ -35,8 +36,14 @@ public sealed class EngineArchiveSetup(AppServices services) : IArchiveSetup
var defaults = services.Settings.ArchiveDefaults();
var archive = await Task.Run(async () =>
{
Directory.CreateDirectory(root);
return await archives.AdoptAsync(root, defaults, cancellationToken).ConfigureAwait(false);
// A new archive is made with its whole layout (the folder itself included), or not at all; an existing one gets
// the folders it lacks. One that can be written but not completed is refused with the reason, before it becomes
// the archive of this PC; a read-only one opens as before, to be browsed.
var opened = await archives.AdoptAsync(root, defaults, cancellationToken).ConfigureAwait(false);
var paths = new ArchivePaths(root);
if (ArchiveStructure.Ensure(paths) is { IsComplete: false } structure && ArchiveVolume.Probe(paths) == ArchiveAvailability.Online)
throw new ArchiveStructureException(structure);
return opened;
}, cancellationToken);
services.Settings.LastArchivePath = root;
services.SaveSettings();