fix(processing): concurrent renders keep their own names; analysis status under the lock; server announces changes

A render reserves the output name it picks, so the same preset queued twice
no longer overwrites one output with the other; render rows take ids from
their job and entry, so a resumed job recognises only its own outputs and
never deletes another render's file. A light pass records its status under
the sequence lock and cannot clear a deep pass's. Renders and Auto value
changes made by the server engine publish sequenceChanged events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 23:16:23 +00:00
1 parent 23c40ece6f
commit c7ca1ef463
9 files changed
+316 -56

No files matched your search

+9 -8
View File
@@ -105,33 +105,34 @@ public static class ExportNaming
/// <summary>
/// Full output path inside <paramref name="folder"/>: the expanded name plus the codec's extension, or the bare name
/// for image sequences (a folder), made unique against existing files and folders.
/// for image sequences (a folder), made unique against existing files and folders and the paths <paramref name="taken"/>
/// says are being written.
/// </summary>
public static string OutputPath(string folder, string template, ExportNameContext context)
public static string OutputPath(string folder, string template, ExportNameContext context, Func<string, bool>? taken = null)
{
ArgumentException.ThrowIfNullOrWhiteSpace(folder);
var name = Expand(template, context).Name;
var extension = VideoCodecInfo.DefaultContainer(context.Codec) == ContainerFormat.ImageSequence ? string.Empty : VideoCodecInfo.FileExtension(context.Codec);
return Unique(folder, name, extension);
return Unique(folder, name, extension, taken);
}
/// <summary>
/// Output path of a project's export: <see cref="ExportSettings.Folder"/> or, when unset, the sequence's exports folder,
/// named by <see cref="ExportSettings.NameTemplate"/>.
/// </summary>
public static string OutputPath(ExportSettings settings, string sequenceExportsFolder, ExportNameContext context)
public static string OutputPath(ExportSettings settings, string sequenceExportsFolder, ExportNameContext context, Func<string, bool>? taken = null)
{
ArgumentNullException.ThrowIfNull(settings);
return OutputPath(string.IsNullOrWhiteSpace(settings.Folder) ? sequenceExportsFolder : settings.Folder, settings.NameTemplate, context);
return OutputPath(string.IsNullOrWhiteSpace(settings.Folder) ? sequenceExportsFolder : settings.Folder, settings.NameTemplate, context, taken);
}
/// <summary>"name.ext", or "name (2).ext", "name (3).ext"… when a file or folder of that name exists.</summary>
public static string Unique(string folder, string name, string extension)
/// <summary>"name.ext", or "name (2).ext", "name (3).ext"… when a file or folder of that name exists or is <paramref name="taken"/>.</summary>
public static string Unique(string folder, string name, string extension, Func<string, bool>? taken = null)
{
for (var n = 1; ; n++)
{
var candidate = Path.Combine(folder, (n == 1 ? name : string.Create(CultureInfo.InvariantCulture, $"{name} ({n})")) + extension);
if (!File.Exists(candidate) && !Directory.Exists(candidate)) return candidate;
if (!File.Exists(candidate) && !Directory.Exists(candidate) && taken?.Invoke(candidate) != true) return candidate;
}
}