Files
Alby96andClaude Opus 5.5 f33bcac32e
CI / Build and test (push) Successful in 13m44s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 16s
Release / Build, test and publish (push) Successful in 26m34s
CI / PostgreSQL 16 integration (push) Failing after 17m36s
CI / PostgreSQL 17 integration (push) Failing after 15m36s
CI / Docker image (push) Successful in 1m12s
Release / Server image (push) Failing after 15s
feat(copies): matches between this PC and the server, Integrate and merge (owner review 6, v1.2.0) (#74)
The same time-lapse on a server and on this PC under different ids, or twice on this PC, is recognised,
compared and settled as the owner asked in owner review 6.

Matches are found after each sync refresh, through the server's new photo lookup, and after the jobs that
change photos. The default is to ask every time. Server › Matches offers:
- Keep apart, which is remembered;
- Link only and Unlink;
- the Compare dialog: photos, details line by line, projects and the plan.

Integrate completes both sides. Photos default to Union, projects are copied across, and a losing version
goes to the trash only after a hash check. Afterwards new photos move by themselves, and deletions wait for
the user.

A merge of two local sequences verifies every photo before the other sequence goes to its archive's trash.
Upload all local skips suspected matches and flags them.

Migration 0012 adds the found_copies and copy_probes tables. Jobs 25 (Integrate) and 26 (MergeSequences) are
new, and so are the server capabilities photo-lookup and upload-into.

Refs #73

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
2026-11-18 15:20:29 +01:00

36 lines
1.3 KiB
C#

using Microsoft.Win32;
namespace Chronos.App.Tests.Setup;
/// <summary>
/// Scratch keys under HKCU\Software\Chronos.Tests for the setup tests, which run in parallel: a key is created, and the
/// shared parent removed once empty, under one lock, so one test's cleanup never deletes the parent while another test
/// is creating its key under it.
/// </summary>
internal static class ScratchRegistry
{
private const string Root = @"Software\Chronos.Tests";
private static readonly Lock Gate = new();
/// <summary>Creates a new empty scratch key and returns its path under HKCU.</summary>
public static string Create()
{
var keyPath = Root + @"\" + Guid.NewGuid().ToString("N");
lock (Gate) Registry.CurrentUser.CreateSubKey(keyPath, writable: true).Dispose();
return keyPath;
}
/// <summary>Deletes a scratch key made by <see cref="Create"/>, and the shared parent too once it is empty.</summary>
public static void Delete(string keyPath)
{
lock (Gate)
{
Registry.CurrentUser.DeleteSubKeyTree(keyPath, throwOnMissingSubKey: false);
bool empty;
using (var tests = Registry.CurrentUser.OpenSubKey(Root)) empty = tests is { SubKeyCount: 0, ValueCount: 0 };
if (empty) Registry.CurrentUser.DeleteSubKey(Root, throwOnMissingSubKey: false);
}
}
}