E4: API dei video fermi e «Salva il fotogramma»

«È un video fermo?» dal visualizzatore (POST /api/media/{id}/still, con
400/404/409/503 e niente salvato negli errori) e l'esito su ogni video
dell'elemento (media[].still), perché l'interfaccia di WP6 lo mostri.

«Salva il fotogramma» salva il fotogramma scelto dall'analisi (il più
nitido, mai uno scuro, risposta 45): «Scarica» da
/api/media/{id}/still/frame con il nome …_fotogramma.png, e «Nella
cartella delle copie» con frames.mode "fermo" attraverso pianificatore,
impostazioni del lavoro e copiatore (FrameMode.Still, suffisso
_fotogramma, stessa identità delle copie dei fotogrammi di E3). Vale per
un video solo (risposta 46); un video non fermo o mai analizzato si
conta come notStill e non si copia.

«Cerca i video fermi» per una selezione: conferma con i conteggi,
avvio, avanzamento e «Interrompi» (/api/still-videos/*). Tutti i DTO nel
FebeJsonContext; i comandi passano dal controllo dell'Origin. Il servizio
registra con ILogger e FebeApp lo chiude all'arresto prima dell'archivio.
LEGGIMI di Febe.Web aggiornato; prove dell'API su video costruiti.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-29 15:29:06 +01:00
1 parent 4f238f2c9f
commit 51150fb611
17 files changed
+695 -18

No files matched your search

+54 -3
View File
@@ -158,7 +158,8 @@ public sealed record CopyJobRequestDto(
/// <summary>
/// Which frames (spec §4.10 «Fotogrammi»): <paramref name="Mode"/> <c>istante</c> (at <paramref name="AtMs"/>),
/// <c>ogni</c> (every <paramref name="EveryMs"/>, at least 100) or <c>numero</c> (<paramref name="Count"/> in all, 1 to
/// 1.000); <paramref name="Format"/> <c>jpg</c>, <c>png</c> (the default) or <c>webplossless</c>.
/// 1.000), or <c>fermo</c> («Salva il fotogramma» of one still video, tappa E4: the instant of its analysis, nothing
/// else); <paramref name="Format"/> <c>jpg</c>, <c>png</c> (the default) or <c>webplossless</c>.
/// </summary>
public sealed record FramesRequestDto(string? Mode, long? AtMs = null, long? EveryMs = null, int? Count = null, string? Format = null);
@@ -186,7 +187,8 @@ public sealed record ExportPlanDestinationDto(
/// converted, <paramref name="Lossy"/> «con perdita»; a frames job: <paramref name="Videos"/>,
/// <paramref name="PhotosSkipped"/>, <paramref name="Frames"/> and <paramref name="OverCap"/> (videos over 1.000
/// frames: the job is refused). <paramref name="Summary"/>: the line of the dialog («312 file · 41 già copiati, saltati ·
/// circa 3 HEIC copiati come sono · circa 4,2 GB · con perdita»).
/// circa 3 HEIC copiati come sono · circa 4,2 GB · con perdita»). Tappa E4, «Salva il fotogramma»:
/// <paramref name="NotStill"/> videos that are not «Fermo» or were never analysed (skipped).
/// </summary>
public sealed record ExportPlanDto(
int Files,
@@ -204,7 +206,8 @@ public sealed record ExportPlanDto(
int PhotosSkipped = 0,
int Frames = 0,
int OverCap = 0,
string? Summary = null);
string? Summary = null,
int NotStill = 0);
/// <summary>The jobs a «Copia in…» started, one per destination (empty: nothing to copy), and the plan it followed.</summary>
public sealed record ExportJobDto(IReadOnlyList<long> RunIds, ExportPlanDto Plan, string Message);
@@ -356,3 +359,51 @@ public sealed record ConversionActionRequest(long ConversionId);
/// the library made from them («elimino gli elementi interi, 9 file e 2 file convertiti»).
/// </summary>
public sealed record EntryDeletionPreviewDto(int Entries, int Files, int ConvertedFiles);
// ---------------------------------------------------------------------------------------------- still videos (tappa E4)
/// <summary>
/// The analysis of a video («È un video fermo?», spec §4.10, tappa E4), on <see cref="MediaDto.Still"/> and as the answer
/// of <c>POST /api/media/{id}/still</c>; a video never analysed has none. <paramref name="Outcome"/>: <c>still</c>,
/// <c>moving</c> or <c>notAnalyzable</c>; <paramref name="Current"/>: made by the algorithm of this Febe (otherwise
/// «Analizza di nuovo»); <paramref name="FrameAtMs"/> and <paramref name="FrameLabel"/> («0:01,125»): the frame
/// «Salva il fotogramma» saves, only on <c>still</c>; <paramref name="Note"/>: English codes separated by spaces
/// (<c>FrameNotAvailable</c>, <c>DurationUnknown</c>, <c>Unreadable</c>, <c>TooSlow</c>, <c>AllDark</c>,
/// <c>SingleColor</c>, <c>SmallMotion</c>); <paramref name="Day"/>: the local day of the analysis (yyyy-MM-dd).
/// </summary>
public sealed record StillVideoDto(string Outcome, bool Current, long? FrameAtMs, string? FrameLabel, string? Note, string Day);
/// <summary>
/// The selection of «Cerca i video fermi»: exactly one of <paramref name="MediaIds"/>, <paramref name="EntryIds"/>
/// (every video of those entries), <paramref name="Query"/> with <paramref name="Mode"/>, or <paramref name="AccountId"/>.
/// </summary>
public sealed record StillVideosSelectionRequest(IReadOnlyList<long>? MediaIds, IReadOnlyList<long>? EntryIds, string? Query, string? Mode, long? AccountId = null);
/// <summary>
/// <c>POST /api/still-videos/plan</c>: the confirmation of «Cerca i video fermi», by file (two entries of one video count
/// once). <paramref name="Videos"/> = <paramref name="ToAnalyse"/> + <paramref name="AlreadyAnalysed"/> (skipped) +
/// <paramref name="Missing"/> (not in the library); <paramref name="PhotosSkipped"/>: photos of the selection;
/// <paramref name="Summary"/>: «28 video da analizzare · 12 già analizzati · le 5 foto si saltano»;
/// <paramref name="Waiting"/>: why the job would wait now (an engine session, an import, copies or a rebuild), or null.
/// </summary>
public sealed record StillVideosPlanDto(int Videos, int ToAnalyse, int AlreadyAnalysed, int PhotosSkipped, int Missing, string Summary, string? Waiting);
/// <summary>
/// The job «Cerca i video fermi» (<c>GET /api/still-videos/progress</c>, and the answer of start and stop):
/// <paramref name="Done"/> of <paramref name="Total"/> settled as <paramref name="Still"/>, <paramref name="Moving"/>,
/// <paramref name="NotAnalyzable"/> or <paramref name="Skipped"/> (file gone or changed); <paramref name="Stopped"/>:
/// ended by «Interrompi»; <paramref name="Waiting"/>: why it waits now; <paramref name="CurrentMediaId"/>: the file analysed
/// now; <paramref name="Summary"/>: «Analizzati 28 video: 3 fermi, 24 in movimento, 1 non analizzabile».
/// </summary>
public sealed record StillVideosProgressDto(
bool Running,
int Total,
int Done,
int Still,
int Moving,
int NotAnalyzable,
int Skipped,
bool Stopped,
string? Waiting,
long? CurrentMediaId,
string Summary);