E4: copie del fotogramma con il loro nome, eventi che non si perdono, visualizzatore che si chiude

«Copia di nuovo» di un _fotogramma lo rifaceva come _t…, e un lavoro in attesa prendeva un istante del file vecchio.
Un'analisi copriva l'evento di una copia finita; il visualizzatore restava sopra la pagina nuova e poteva mostrare un
esito superato; la scheda Esportazione perdeva il fuoco a ogni rilettura.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-01 18:57:58 +01:00
1 parent 6dcaf30db6
commit 2c0cfcccf2
17 files changed
+301 -35

No files matched your search

+16 -2
View File
@@ -576,9 +576,23 @@ public sealed class ExportCopier(ExportEnvironment env)
}
var sha = library.Sha256;
var (mode, count) = x.Frames ?? (FrameMode.At, 1);
TimeSpan? chosen = null;
if (mode == FrameMode.Still && !string.Equals(batch[0].SourceSha256, sha, StringComparison.Ordinal))
{
// The file changed since the frame was chosen (a job that waited): the instant is the one of the analysis of
// the new file, or there is none (the item keeps the one it was recorded with, the copy says the true one).
if (await _env.Storage.VideoAnalyses.GetAsync(sha, ct).ConfigureAwait(false) is not { Outcome: VideoAnalysisOutcome.Still, FrameAt: { } at })
{
await EndAllAsync(batch, ExportItemState.Skipped, ExportText.Notes.NotStill, null).ConfigureAwait(false);
return null;
}
chosen = at;
}
batch = batch.Select(i => string.Equals(i.SourceSha256, sha, StringComparison.Ordinal) ? i : i with { SourceSha256 = sha }).ToList();
var format = batch[0].Format;
var (mode, count) = x.Frames ?? (FrameMode.At, 1);
var firstId = mode == FrameMode.Count
? await exports.FirstItemIdAsync(x.Run.Id, library.Media.Id, ExportVariant.Frame, format, ct).ConfigureAwait(false) ?? batch[0].Id
: 0;
@@ -625,7 +639,7 @@ public sealed class ExportCopier(ExportEnvironment env)
: [];
using (reader)
{
var targets = info.Available ? reader.Locate([.. batch.Select(i => i.FrameAt ?? TimeSpan.Zero)]) : [];
var targets = info.Available ? reader.Locate([.. batch.Select(i => chosen ?? i.FrameAt ?? TimeSpan.Zero)]) : [];
if (targets.Count != batch.Count)
{
await EndAllAsync(batch, ExportItemState.Skipped, ExportText.Notes.FrameNotAvailable, null).ConfigureAwait(false);
+2 -1
View File
@@ -54,7 +54,8 @@ public sealed record ExportFormatChoice(ExportFormat? Photo, ExportFormat? Video
/// <summary>«Copia di nuovo» of one copy row (tappa E3, D11): the form of that row, looked up only by its exact identity.</summary>
/// <param name="FrameAt">The instant of a frame row; null otherwise.</param>
public sealed record ExportCopyRequest(ExportVariant Variant, ExportFormat Format, TimeSpan? FrameAt);
/// <param name="Still">The frame row is one of «Salva il fotogramma»: the new file is named <c>…_fotogramma</c> again.</param>
public sealed record ExportCopyRequest(ExportVariant Variant, ExportFormat Format, TimeSpan? FrameAt, bool Still = false);
/// <summary>A «Copia in…»: what to copy, whether «Tolti» and «Superati» are copied again (D9), who asked.</summary>
/// <param name="Formats">The formats of this request («Copia in…» → «Cambia»); null: those of the destination.</param>
+2 -2
View File
@@ -303,9 +303,9 @@ public sealed class ExportService : IAsyncDisposable
{
await ExportRunSettings.SetFramesAsync(store, runId, frames.Mode, frames.Count ?? 0, none).ConfigureAwait(false);
}
else if (request.Exact is { Variant: ExportVariant.Frame })
else if (request.Exact is { Variant: ExportVariant.Frame } exact)
{
await ExportRunSettings.SetFramesAsync(store, runId, FrameMode.At, 1, none).ConfigureAwait(false);
await ExportRunSettings.SetFramesAsync(store, runId, exact.Still ? FrameMode.Still : FrameMode.At, 1, none).ConfigureAwait(false);
}
if (request.Exact is not null)
+4
View File
@@ -39,6 +39,9 @@ public static class ExportText
public const string AsIsTooLarge = ImageConversionLosses.AsIsTooLarge;
public const string AsIsNotRemuxable = MediaConversionResult.AsIsNotRemuxable;
public const string FrameNotAvailable = "FrameNotAvailable";
// Tappa E4: «Salva il fotogramma» of a file that changed meanwhile, and is not a still video as far as Febe knows.
public const string NotStill = "NotStill";
public const string TransparencyWhite = ImageConversionLosses.TransparencyWhite;
public const string CopiedInAnotherFormat = "CopiedInAnotherFormat";
public const string LostTracks = Mp4Remuxer.LostTracks;
@@ -142,6 +145,7 @@ public static class ExportText
Notes.AsIsCmyk => "Copiato com'è: immagine CMYK",
Notes.AsIsTooLarge => "Copiato com'è: troppo grande per il formato scelto",
Notes.FrameNotAvailable => "Fotogramma non disponibile per questo video",
Notes.NotStill => "Il video è cambiato: il file di adesso non è un video fermo, o non è stato analizzato",
Notes.TransparencyWhite => "La trasparenza è diventata bianco",
Notes.CopiedInAnotherFormat => "Già copiato in un altro formato",
ImageConversionLosses.LostTexts => "Non tenuti: testi",