E3: formati e fotogrammi nella copia verso le cartelle esterne

La richiesta di copia porta i formati («Copia in…» per foto e video, poi
la destinazione, poi le impostazioni), i fotogrammi dei video e la «Copia
di nuovo» di una sola copia. Il piano prevede convertiti, copiati com'è e
fotogrammi; il lavoro si ricorda di fotogrammi ed identità esatta per la
ripresa.

La copia converte prima dei controlli di spazio e di FAT32, adotta un file
già presente solo se lunghezza e SHA-256 della conversione coincidono, e
prende i fotogrammi di un video in un solo passaggio, ognuno con il suo
istante esatto come identità. Un file copiato in qualunque forma che non
sia un fotogramma è «già copiato»; un fotogramma non rende mai copiato il
file (nuovo segno FrameOnly). Le note sono un elenco di codici, con i testi
italiani nuovi e il rapporto che mostra i file copiati con una nota.

Le prove dell'archivio e dei piani delle query seguono le nuove ricerche;
due prove nuove coprono una foto convertita e un fotogramma.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-27 23:08:38 +01:00
1 parent 704c1ed9cf
commit b746aff45d
19 files changed
+1941 -257

No files matched your search

+56 -1
View File
@@ -11,6 +11,53 @@ internal static class ExportRunSettings
{
public static string CopyAgainKey(long runId) => string.Create(CultureInfo.InvariantCulture, $"esportazione.lavoro.{runId}.copia-di-nuovo");
/// <summary>How the frames of a frames job were asked (tappa E3): <c>Istante</c>, <c>Ogni</c> or <c>Numero:N</c>.</summary>
public static string FramesKey(long runId) => string.Create(CultureInfo.InvariantCulture, $"esportazione.lavoro.{runId}.fotogrammi");
/// <summary>«Copia di nuovo» of one copy row: only its exact identity is looked up (decision D11 of tappa E3).</summary>
public static string ExactKey(long runId) => string.Create(CultureInfo.InvariantCulture, $"esportazione.lavoro.{runId}.esatta");
/// <summary>The frames request of a job, or null for a job of whole or converted files.</summary>
public static async Task<(FrameMode Mode, int Count)?> GetFramesAsync(ISettingsStore store, long runId, CancellationToken ct)
{
var text = (await store.GetAsync(FramesKey(runId), ct).ConfigureAwait(false))?.Trim();
if (text is null)
{
return null;
}
if (string.Equals(text, "Istante", StringComparison.Ordinal))
{
return (FrameMode.At, 1);
}
if (string.Equals(text, "Ogni", StringComparison.Ordinal))
{
return (FrameMode.Every, 0);
}
return text.StartsWith("Numero:", StringComparison.Ordinal)
&& int.TryParse(text.AsSpan("Numero:".Length), NumberStyles.None, CultureInfo.InvariantCulture, out var count) && count > 0
? (FrameMode.Count, count)
: null;
}
public static Task SetFramesAsync(ISettingsStore store, long runId, FrameMode mode, int count, CancellationToken ct) =>
store.SetAsync(
FramesKey(runId),
mode switch
{
FrameMode.At => "Istante",
FrameMode.Every => "Ogni",
_ => string.Create(CultureInfo.InvariantCulture, $"Numero:{count}"),
},
ct);
public static async Task<bool> GetExactAsync(ISettingsStore store, long runId, CancellationToken ct) =>
string.Equals((await store.GetAsync(ExactKey(runId), ct).ConfigureAwait(false))?.Trim(), "1", StringComparison.Ordinal);
public static Task SetExactAsync(ISettingsStore store, long runId, CancellationToken ct) => store.SetAsync(ExactKey(runId), "1", ct);
/// <summary>«Copia di nuovo anche i tolti o superati» was chosen for this job (decision D9).</summary>
public static async Task<bool> GetCopyAgainAsync(ISettingsStore store, long runId, CancellationToken ct)
{
@@ -21,6 +68,14 @@ internal static class ExportRunSettings
public static Task SetCopyAgainAsync(ISettingsStore store, long runId, bool value, CancellationToken ct) =>
store.SetAsync(CopyAgainKey(runId), value ? "1" : null, ct);
/// <summary>Every key of the job, in one transaction (a run id can be used again after <c>DeleteRunAsync</c>).</summary>
public static Task ClearAsync(ISettingsStore store, long runId, CancellationToken ct) =>
store.SetAsync(CopyAgainKey(runId), null, ct);
store.SetManyAsync(
new Dictionary<string, string?>
{
[CopyAgainKey(runId)] = null,
[FramesKey(runId)] = null,
[ExactKey(runId)] = null,
},
ct);
}