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

+48 -15
View File
@@ -162,6 +162,12 @@ public interface IExportStore
Task<ExportItem?> GetItemAsync(long itemId, CancellationToken ct = default);
/// <summary>
/// The first item of a library file in a job with this variant and format, any state; null when none. The frames of
/// a video are added together in instant order, so an item's position among them is its id minus this one.
/// </summary>
Task<long?> FirstItemIdAsync(long runId, long mediaId, ExportVariant variant, ExportFormat format, CancellationToken ct = default);
/// <summary>Items of a job, by key, with an optional state.</summary>
Task<IReadOnlyList<ExportItem>> ListItemsAsync(ExportItemQuery query, CancellationToken ct = default);
@@ -177,22 +183,40 @@ public interface IExportStore
Task<IReadOnlyDictionary<long, bool>> ListAccountExportSwitchesAsync(CancellationToken ct = default);
/// <summary>
/// The newest Superseded or Removed row of (destination, account) whose <see cref="ExportCopy.SupersededBySha256"/> is
/// this SHA-256: the library file that took the place of a copied one, never copied again by itself.
/// The newest Superseded or Removed row, not a frame, of (destination, account) whose
/// <see cref="ExportCopy.SupersededBySha256"/> is this SHA-256: the library file that took the place of a copied one,
/// never copied again by itself (a superseded frame never makes the file «Superato»).
/// </summary>
Task<ExportCopy?> FindReplacedCopyAsync(long destinationId, long accountId, string sha256, CancellationToken ct = default);
/// <summary>
/// «Una copia sola»: the newest Copied row of this original, variant and format in a destination in use (the general
/// folder or the own folder of an account still in Febe), of an account still in Febe; with
/// <paramref name="exceptAccountId"/>, of an account other than that one, so a newer row of the account itself never
/// hides the copy of another account (decision of 2026-11-27: «una copia altrove conta solo se è di un altro account»).
/// «Una copia sola»: the newest Copied row of this original, in any form but a frame (whole or converted, decision D3
/// of tappa E3), in a destination in use (the general folder or the own folder of an account still in Febe), of an
/// account still in Febe; with <paramref name="exceptAccountId"/>, of an account other than that one, so a newer row
/// of the account itself never hides the copy of another account (decision of 2026-11-27: «una copia altrove conta
/// solo se è di un altro account»).
/// </summary>
Task<ExportCopy?> FindCopiedElsewhereAsync(string sha256, ExportVariant variant, ExportFormat format, long? exceptAccountId = null, CancellationToken ct = default);
Task<ExportCopy?> FindCopiedElsewhereAsync(string sha256, long? exceptAccountId = null, CancellationToken ct = default);
/// <summary>
/// The state of whole copies (<see cref="ExportVariant.Whole"/>, <see cref="ExportFormat.Original"/>) of (account,
/// SHA-256) pairs in one destination, for the plan: the current row (Copied or Failed) first, else the newest row
/// The current (Copied or Failed) rows of an original for an account in a destination, in any form but a frame,
/// newest first: «già copiato» looks at the file, not at its format (decision D3 of tappa E3).
/// </summary>
Task<IReadOnlyList<ExportCopy>> ListCurrentCopiesAnyFormAsync(long destinationId, long accountId, string sha256, CancellationToken ct = default);
/// <summary>The newest row, in any state and any form but a frame, of an original for an account in a destination (D3 of tappa E3).</summary>
Task<ExportCopy?> FindLatestCopyAnyFormAsync(long destinationId, long accountId, string sha256, CancellationToken ct = default);
/// <summary>
/// After a copy of an original succeeded: its other current «Non riuscito» rows in any form but a frame, for the
/// account in the destination, are deleted (they have no file; the identity <paramref name="except"/> is kept).
/// Returns the rows deleted.
/// </summary>
Task<int> ClearFailedAsync(long destinationId, long accountId, string sha256, ExportCopyIdentity except, CancellationToken ct = default);
/// <summary>
/// The state of the copies of (account, SHA-256) pairs in one destination, in any form but a frame (decision D3 of
/// tappa E3), for the plan: Copied when a current row is Copied, else Failed when one is Failed, else the newest row
/// when Removed or Superseded, else Removed or Superseded when a row was replaced by this SHA-256
/// (<see cref="FindReplacedCopyAsync"/>). Pairs without any are absent.
/// </summary>
@@ -227,7 +251,7 @@ public interface IExportStore
/// </summary>
Task<IReadOnlyDictionary<long, ExportEntryCopies>> GetEntryCopyCountsAsync(IReadOnlyList<long> entryIds, CancellationToken ct = default);
/// <summary>The mark of single files («Tutte le foto»): Copied or None; files that are not due are absent.</summary>
/// <summary>The mark of single files («Tutte le foto»): Copied, FrameOnly or None; files that are not due are absent.</summary>
Task<IReadOnlyDictionary<long, ExportMark>> GetFileMarksAsync(IReadOnlyList<long> mediaIds, CancellationToken ct = default);
/// <summary>The counts of the account card: «312 su 1.204 non ancora copiati» (decision D3 of tappa E2).</summary>
@@ -246,7 +270,8 @@ public sealed record ExportCandidate(
long? Bytes,
string? RelativePath,
int Position,
bool InHighlight);
bool InHighlight,
TimeSpan? Duration = null);
/// <summary>The copy mark of a tile (spec §4.10): «Non ancora copiato», «Copiato in parte», «Copiato».</summary>
public enum ExportMark
@@ -254,13 +279,21 @@ public enum ExportMark
None,
Partly,
Copied,
/// <summary>«Solo fotogrammi»: no due file is copied, at least one has a frame copied (decision D4 of tappa E3).</summary>
FrameOnly,
}
/// <summary>The due files of an entry and how many are copied (decision D3 of tappa E2).</summary>
public sealed record ExportEntryCopies(int Due, int Copied)
/// <summary>
/// The due files of an entry and how many are copied (decision D3 of tappa E2): a frame never makes a file copied; a
/// file with only frames copied counts in <paramref name="FrameOnly"/> (decision D4 of tappa E3).
/// </summary>
public sealed record ExportEntryCopies(int Due, int Copied, int FrameOnly = 0)
{
/// <summary>«Non ancora copiato» (none), «Copiato in parte», «Copiato».</summary>
public ExportMark Mark => Copied <= 0 ? ExportMark.None : Copied >= Due ? ExportMark.Copied : ExportMark.Partly;
/// <summary>«Non ancora copiato» (none), «Solo fotogrammi», «Copiato in parte», «Copiato».</summary>
public ExportMark Mark => Copied <= 0
? FrameOnly > 0 ? ExportMark.FrameOnly : ExportMark.None
: Copied >= Due ? ExportMark.Copied : ExportMark.Partly;
}
/// <summary>Counts of the due files of an account (decision D3 of tappa E2).</summary>