«Riprendi» e «Riprendi tutte» restano attivi mentre lavora una copia automatica, che cede il passo (risposta 49): li spegne solo un lavoro di Alberto. «Annulla» di un lavoro automatico dice che i file ripartono da soli; la risposta a «Interrompi» dice l'ora come il resto («all'1:20», «domani alle 0:30»), e «dal» si elide («dall'8 dicembre»). Nella finestra della cartella «Salva» aspetta il conto dei tipi di adesso, un conto non riuscito si richiede e il suo errore resta, il fuoco della tastiera non salta; una nota dice perché «Automatica» è spenta senza cartelle scrivibili. «Riprendi ora» torna attivo se la richiesta fallisce. Il conto dei file che aspettano si condivide fra letture e non si fa per la scheda di un account senza cartella sua; sul telefono i pulsanti della tabella delle cartelle vanno a capo. Prove nuove: chiusura che ferma prima il lavoratore, percorso troppo lungo, attesa di due minuti dall'ultimo file e tetto di un quarto d'ora. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
469 lines
26 KiB
C#
469 lines
26 KiB
C#
namespace Febe.Web.Api;
|
|
|
|
// JSON shapes of the copies to external folders (spec §4.10, tappa E2). Same conventions as Dtos.cs: English camelCase
|
|
// names, Italian texts, times as LocalTimeDto. Names of states and types on the wire:
|
|
// scope «general»|«account»; types «postFoto», «postVideo», «storie», «evidenza», «taggati», «profilo»;
|
|
// copy states «copied», «removed», «superseded», «failed»; job states «running», «interrupted», «paused», «completed»,
|
|
// «cancelled»; file states «pending», «copied», «adopted», «alreadyCopied», «skipped», «missing», «failed».
|
|
|
|
/// <summary>
|
|
/// Where copies can go. <paramref name="Docker"/>: destinations are subfolders of <paramref name="Root"/> (the page
|
|
/// lists them); otherwise any folder, with the native picker when <paramref name="PickFolder"/>.
|
|
/// <paramref name="Active"/> false: nothing can be written, <paramref name="Problem"/> says why.
|
|
/// </summary>
|
|
public sealed record ExportRootDto(bool Docker, bool Active, string? Root, string? Problem, bool PickFolder);
|
|
|
|
/// <summary>The library's naming schemes, to prefill «Uno schema suo», and the placeholders.</summary>
|
|
public sealed record ExportSchemesDto(string General, string Highlight, string Profile, IReadOnlyList<string> Placeholders);
|
|
|
|
/// <summary>
|
|
/// A destination. <paramref name="Display"/> is the folder as shown («/esporta/usb» in Docker). <paramref name="Types"/>
|
|
/// are the wire names of the content types; null schemes are «Come la libreria». <paramref name="Problem"/>: the reason
|
|
/// of its pause (or, with <c>/status</c>, why it does not answer now). <paramref name="Counts"/>: copies per state
|
|
/// (<c>copied</c>, <c>removed</c>, <c>superseded</c>, <c>failed</c>). <paramref name="Reachable"/> and
|
|
/// <paramref name="FreeBytes"/> only from <c>/status</c>. <paramref name="Orphan"/>: an own folder whose account was
|
|
/// removed («era di @<paramref name="FormerUsername"/>»). Tappa E5: <paramref name="Automatic"/> is «Automatica»,
|
|
/// <paramref name="AutomaticSince"/> its «Solo i nuovi» instant («Automatica dal …»; null with «Copia anche quelli già
|
|
/// in libreria» or when it is off); <paramref name="Waiting"/>, only for a destination in pause, the files that wait for
|
|
/// it: what it would copy by itself when it is automatic, else what its unfinished jobs still have to copy.
|
|
/// </summary>
|
|
public sealed record ExportDestinationDto(
|
|
long Id,
|
|
string Scope,
|
|
long? AccountId,
|
|
string? Username,
|
|
string Label,
|
|
string RootPath,
|
|
string Display,
|
|
IReadOnlyList<string> Types,
|
|
string? NamingScheme,
|
|
string? HighlightNamingScheme,
|
|
string? ProfileNamingScheme,
|
|
bool Automatic,
|
|
LocalTimeDto? PausedAt,
|
|
string? Problem,
|
|
IReadOnlyDictionary<string, int> Counts,
|
|
bool? Reachable = null,
|
|
long? FreeBytes = null,
|
|
bool Orphan = false,
|
|
string? FormerUsername = null,
|
|
string? PhotoFormat = null,
|
|
string? VideoFormat = null,
|
|
LocalTimeDto? AutomaticSince = null,
|
|
int? Waiting = null);
|
|
|
|
/// <summary>
|
|
/// <c>GET /api/export</c>: Impostazioni → Esportazione and the notice of the Dashboard. <paramref name="SamePost"/>:
|
|
/// <c>onePerAccount</c> or <c>oneOnly</c>. <paramref name="UnfinishedRuns"/>: interrupted or paused jobs of Alberto
|
|
/// («Riprendi»); the automatic ones resume by themselves and are not counted (tappa E5).
|
|
/// Formats (tappa E3) on the wire: <c>original</c>, <c>jpg</c>, <c>png</c>, <c>webplossless</c>, <c>mp4</c>; the
|
|
/// library ones are <c>original</c> while the conversion of the library is off. <paramref name="LibraryConversion"/>:
|
|
/// the state of that conversion. <paramref name="Automatic"/>: the automatic copies (tappa E5), null when they do not
|
|
/// run (the demonstration, a start with problems).
|
|
/// </summary>
|
|
public sealed record ExportOverviewDto(
|
|
ExportRootDto Root,
|
|
string SamePost,
|
|
ExportDestinationDto? General,
|
|
IReadOnlyList<ExportDestinationDto> Own,
|
|
IReadOnlyList<long> ActiveRunIds,
|
|
int UnfinishedRuns,
|
|
ExportSchemesDto Library,
|
|
string PhotoFormat = "original",
|
|
string VideoFormat = "original",
|
|
string LibraryPhotoFormat = "original",
|
|
string LibraryVideoFormat = "original",
|
|
LibraryConversionDto? LibraryConversion = null,
|
|
ExportAutomaticStatusDto? Automatic = null);
|
|
|
|
/// <summary>
|
|
/// The automatic copies now (tappa E5, spec §4.10): <paramref name="AnyAutomatic"/> a destination in use has «Automatica»
|
|
/// on; <paramref name="Waiting"/> why they wait (an engine session, an import, a copy of Alberto's…), or null;
|
|
/// <paramref name="LastRound"/> and <paramref name="NextRound"/> of the recovery round («giro di recupero», at start-up and
|
|
/// every hour); <paramref name="HeldUntil"/>: «Interrompi» stopped them until then («Riprendi ora»).
|
|
/// </summary>
|
|
public sealed record ExportAutomaticStatusDto(bool AnyAutomatic, string? Waiting, LocalTimeDto? LastRound, LocalTimeDto? NextRound, LocalTimeDto? HeldUntil);
|
|
|
|
/// <summary>
|
|
/// <c>POST /api/export/automatic-preview</c> (tappa E5): how many files an automatic destination would copy by itself.
|
|
/// <paramref name="Mode"/>:
|
|
/// <c>switchOn</c>, the question «Solo i nuovi / Copia anche gli N già in libreria» when «Automatica» is turned on (the
|
|
/// destination as the dialog has it: <paramref name="Scope"/>, <paramref name="AccountId"/>, <paramref name="Path"/>,
|
|
/// <paramref name="Types"/>; the copies of <paramref name="DestinationId"/> count only while the folder stays the same);
|
|
/// <c>widen</c>, the files in more when <paramref name="Types"/> add types to the automatic destination
|
|
/// <paramref name="DestinationId"/>;
|
|
/// <c>removeOwn</c>, the files of <paramref name="AccountId"/> that go by themselves to the automatic general folder
|
|
/// once its own folder is taken away;
|
|
/// <c>account</c>, the files of <paramref name="AccountId"/> that its automatic destination copies by itself
|
|
/// («Esporta questo account» turned on again).
|
|
/// </summary>
|
|
public sealed record ExportAutomaticPreviewRequest(
|
|
string Mode,
|
|
long? DestinationId = null,
|
|
string? Scope = null,
|
|
long? AccountId = null,
|
|
string? Path = null,
|
|
IReadOnlyList<string>? Types = null);
|
|
|
|
/// <summary>
|
|
/// What <c>POST /api/export/automatic-preview</c> counted: <paramref name="Files"/>, the bytes of their originals
|
|
/// («circa»), the line to show and, for a stored folder, its free space (null when unknown).
|
|
/// </summary>
|
|
public sealed record ExportAutomaticPreviewDto(int Files, long Bytes, string Text, long? FreeBytes = null);
|
|
|
|
/// <summary>«Riconosci le copie già presenti» started (tappa E5): the message and the job.</summary>
|
|
public sealed record ExportRecognizeStartedDto(string Message, long RunId);
|
|
|
|
/// <summary>
|
|
/// The conversion of the library (tappa E3, spec §4.10): files in the queue, converted, failed («Riprova»), that never
|
|
/// convert (<paramref name="AsIs"/>: «non si convertono»), «In pausa», and why it waits (Italian, null when it does
|
|
/// not): an import, a copy or a rebuild at work, an engine session, low space. <paramref name="Text"/>: the status line
|
|
/// («In coda 12 · convertiti 340 · non riusciti 2 · non si convertono 3»). <paramref name="On"/>: a library format is
|
|
/// chosen.
|
|
/// </summary>
|
|
public sealed record LibraryConversionDto(int Pending, int Converted, int Failed, int AsIs, bool Paused, string? Waiting, string Text, bool On);
|
|
|
|
/// <summary>
|
|
/// <c>PUT /api/export/settings</c>, every field optional (null keeps it): «Lo stesso post in due account»
|
|
/// (<c>onePerAccount</c> or <c>oneOnly</c>), the formats of the copies and of the library (wire names).
|
|
/// <paramref name="ConvertExisting"/>: the answer «Anche i N già in libreria» when a library format is turned on or
|
|
/// changed; it queues the files of the kinds whose library format this request changes, never those of the other.
|
|
/// </summary>
|
|
public sealed record ExportSettingsRequest(
|
|
string? SamePost = null,
|
|
string? PhotoFormat = null,
|
|
string? VideoFormat = null,
|
|
string? LibraryPhotoFormat = null,
|
|
string? LibraryVideoFormat = null,
|
|
bool? ConvertExisting = null);
|
|
|
|
/// <summary>What <c>PUT /api/export/settings</c> did: a message, the overview after the change, the files queued.</summary>
|
|
public sealed record ExportSettingsSavedDto(string Message, ExportOverviewDto Overview, int Queued = 0);
|
|
|
|
/// <summary>
|
|
/// «Converti anche i N file già in libreria?»: <paramref name="Files"/> that would enter the queue, the bytes of their
|
|
/// originals («circa») and the line of the question («gli originali occupano circa 3,1 GB; i convertiti possono occupare
|
|
/// di più»).
|
|
/// </summary>
|
|
public sealed record LibraryConversionPreviewDto(int Files, long Bytes, string Text);
|
|
|
|
/// <summary>Docker: the subfolders of a folder of <c>/esporta</c>. <paramref name="Relative"/> is "" for the root.</summary>
|
|
public sealed record ExportFolderListDto(string Relative, string? Parent, string Display, IReadOnlyList<SourceFolderDto> Folders);
|
|
|
|
/// <summary><c>POST /api/export/pick-folder</c>: the destination being changed, to open the picker on its folder.</summary>
|
|
public sealed record ExportPickRequest(long? DestinationId);
|
|
|
|
/// <summary>The check of a candidate folder (before saving). <paramref name="Fat32"/>: files over 4 GB cannot go there.</summary>
|
|
public sealed record ExportFolderCheckDto(bool Accepted, string FullPath, string Display, string? Problem, long? FreeBytes, bool Fat32);
|
|
|
|
/// <summary>The «Risultato» of a destination's naming. <paramref name="Scope"/>: general or account; null schemes are the library's.</summary>
|
|
public sealed record ExportNamingPreviewRequest(string Scope, string? General, string? Highlight, string? Profile);
|
|
|
|
/// <summary>
|
|
/// A destination to add or change. <paramref name="Path"/>: in Docker the folder relative to <c>/esporta</c> (as listed),
|
|
/// elsewhere the full path. <paramref name="Types"/>: wire names, at least one. Null or empty schemes: «Come la
|
|
/// libreria». <paramref name="Automatic"/>: «Automatica» (tappa E5); <paramref name="OnlyNew"/> is the answer when it is
|
|
/// turned on («Solo i nuovi»; false: «Copia anche quelli già in libreria»), kept while it stays on.
|
|
/// </summary>
|
|
public sealed record ExportDestinationRequest(
|
|
string Scope,
|
|
long? AccountId,
|
|
string Path,
|
|
string? Label,
|
|
IReadOnlyList<string> Types,
|
|
string? NamingScheme,
|
|
string? HighlightNamingScheme,
|
|
string? ProfileNamingScheme,
|
|
bool Automatic = false,
|
|
bool OnlyNew = true,
|
|
string? PhotoFormat = null,
|
|
string? VideoFormat = null);
|
|
|
|
/// <summary>A saved destination (a change of folder gives a new id) and the warnings of its schemes.</summary>
|
|
public sealed record ExportDestinationSavedDto(ExportDestinationDto Destination, IReadOnlyList<string> Warnings);
|
|
|
|
/// <summary>
|
|
/// What a «Copia in…» copies: exactly one of <paramref name="MediaIds"/> (files of «Tutte le foto» or the viewer),
|
|
/// <paramref name="EntryIds"/> (a grouped selection), <paramref name="Query"/> (the filter of the Libreria, as its query
|
|
/// string, with <paramref name="Mode"/> <c>grouped</c> or <c>files</c>) or <paramref name="AccountId"/> (every file of
|
|
/// the account). <paramref name="CopyAgain"/>: «Copia di nuovo anche i tolti o superati». Tappa E3:
|
|
/// <paramref name="PhotoFormat"/>/<paramref name="VideoFormat"/> override the destination's for this request only
|
|
/// (null: as the destination); <paramref name="Frames"/> makes it a frames job («Fotogrammi…» → «Nella cartella delle
|
|
/// copie»), without formats.
|
|
/// </summary>
|
|
public sealed record CopyJobRequestDto(
|
|
IReadOnlyList<long>? MediaIds,
|
|
IReadOnlyList<long>? EntryIds,
|
|
string? Query,
|
|
string? Mode,
|
|
long? AccountId,
|
|
bool CopyAgain = false,
|
|
string? PhotoFormat = null,
|
|
string? VideoFormat = null,
|
|
FramesRequestDto? Frames = null);
|
|
|
|
/// <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), 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);
|
|
|
|
/// <summary>Files of a plan copied as they are, of one kind («3 HEIC copiati come sono»).</summary>
|
|
public sealed record ExportPlanAsIsDto(string Label, int Files);
|
|
|
|
/// <summary>A destination of a plan. <paramref name="Problem"/>: why it cannot be written now (paused, not reachable).</summary>
|
|
public sealed record ExportPlanDestinationDto(
|
|
long Id,
|
|
string Label,
|
|
string Display,
|
|
string Scope,
|
|
string? Username,
|
|
int Files,
|
|
long Bytes,
|
|
bool Paused,
|
|
string? Problem,
|
|
long? FreeBytes);
|
|
|
|
/// <summary>
|
|
/// The summary of «Copia in…» (spec §10.3). <paramref name="Files"/>/<paramref name="Bytes"/>: what will be written
|
|
/// (with «Copia di nuovo» the tolti/superati too). <paramref name="NotExported"/>: of accounts that are not exported
|
|
/// (switch off, no destination, type not taken). <paramref name="Missing"/>: not in the library. Tappa E3:
|
|
/// <paramref name="AsIs"/> files predicted copied as they are («circa»), <paramref name="Converted"/> predicted
|
|
/// 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»). 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,
|
|
long Bytes,
|
|
int AlreadyCopied,
|
|
int RemovedOrSuperseded,
|
|
int NotExported,
|
|
int Missing,
|
|
IReadOnlyList<ExportPlanDestinationDto> Destinations,
|
|
bool HasDestination = true,
|
|
IReadOnlyList<ExportPlanAsIsDto>? AsIs = null,
|
|
int Converted = 0,
|
|
bool Lossy = false,
|
|
int Videos = 0,
|
|
int PhotosSkipped = 0,
|
|
int Frames = 0,
|
|
int OverCap = 0,
|
|
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);
|
|
|
|
/// <summary>«Copia di nuovo» of a copy «Tolto» or «Superato» (the viewer).</summary>
|
|
public sealed record CopyAgainRequest(long CopyId);
|
|
|
|
/// <summary>
|
|
/// <c>GET /api/export/progress</c>, polled by the Dashboard tab. <paramref name="Phase"/>: preparing, checking,
|
|
/// waitingForSession, copying, finished. <paramref name="ByState"/>: files of the job per state. Tappa E5, from the job
|
|
/// being worked on: <paramref name="Kind"/> <c>copy</c> or <c>recognize</c> (null for «Controlla le copie»),
|
|
/// <paramref name="Origin"/> <c>manual</c> or <c>automatic</c>. <paramref name="ManualRunning"/>: a job of Alberto's runs
|
|
/// or starts (an automatic one is not: «Riprendi» makes it give way, answer 49).
|
|
/// </summary>
|
|
public sealed record ExportProgressDto(
|
|
long? RunId,
|
|
string Phase,
|
|
double Fraction,
|
|
int FilesDone,
|
|
int FilesTotal,
|
|
long BytesDone,
|
|
long BytesTotal,
|
|
string? CurrentFile,
|
|
string? Destination,
|
|
IReadOnlyDictionary<string, int> ByState,
|
|
bool Running,
|
|
string? Error,
|
|
string? Kind = null,
|
|
string? Origin = null,
|
|
bool ManualRunning = false);
|
|
|
|
/// <summary>An export job. <paramref name="Kind"/>: copy or recognize; <paramref name="Origin"/>: manual or automatic.</summary>
|
|
public sealed record ExportRunDto(
|
|
long Id,
|
|
long DestinationId,
|
|
string Destination,
|
|
string Kind,
|
|
string Origin,
|
|
string State,
|
|
LocalTimeDto StartedAt,
|
|
LocalTimeDto? CompletedAt,
|
|
string? Error,
|
|
int Total,
|
|
int Done,
|
|
bool Running = false);
|
|
|
|
/// <summary>
|
|
/// The files of one account in a job (<paramref name="Copied"/> counts written and adopted files).
|
|
/// <paramref name="AsIs"/>: files copied as they are, by kind («HEIC» → 3).
|
|
/// </summary>
|
|
public sealed record ExportReportAccountDto(long? AccountId, string Username, int Copied, int AlreadyCopied, int Skipped, int Failed, IReadOnlyDictionary<string, int>? AsIs = null);
|
|
|
|
/// <summary>A file of the report that needs a look, with its reason in Italian.</summary>
|
|
public sealed record ExportReportLineDto(long ItemId, string Username, string? Path, string State, string Text);
|
|
|
|
/// <summary>
|
|
/// The report of a job (at most 200 problems). <paramref name="Notes"/> (tappa E3): files copied or adopted with a note
|
|
/// (what a conversion could not keep, a file copied as it is), at most 200. Tappa E5, for «Riconosci le copie già
|
|
/// presenti»: of the skipped files, <paramref name="NotFound"/> are not in the folder and <paramref name="Different"/>
|
|
/// have another file where the copy would be (those are problems; the ones not found are not).
|
|
/// </summary>
|
|
public sealed record ExportReportDto(
|
|
ExportRunDto Run,
|
|
IReadOnlyDictionary<string, int> ByState,
|
|
long BytesCopied,
|
|
IReadOnlyList<ExportReportAccountDto> Accounts,
|
|
IReadOnlyList<ExportReportLineDto> Problems,
|
|
IReadOnlyList<ExportReportLineDto>? Notes = null,
|
|
int NotFound = 0,
|
|
int Different = 0);
|
|
|
|
/// <summary>
|
|
/// A copy of a file of the viewer (spec §4.6, §4.10). <paramref name="State"/>: copied, removed, superseded, failed;
|
|
/// <paramref name="Variant"/>: whole, converted or frame; <paramref name="Format"/>: the wire name of a converted copy or
|
|
/// of a frame (null for a whole one); <paramref name="FrameAtMs"/> and <paramref name="FrameLabel"/> («0:01,25») for a
|
|
/// frame. <paramref name="ForAccount"/>: with «Una copia sola», the account it was copied for when it is another one.
|
|
/// <paramref name="CanCopyAgain"/>: «Copia di nuovo» of that same form. <paramref name="Notes"/>: why it failed.
|
|
/// </summary>
|
|
public sealed record MediaCopyDto(
|
|
long CopyId,
|
|
string Destination,
|
|
bool DestinationRetired,
|
|
string State,
|
|
string Variant,
|
|
string? Format,
|
|
long? FrameAtMs,
|
|
LocalTimeDto At,
|
|
string? ForAccount,
|
|
bool CanCopyAgain,
|
|
string? FrameLabel = null,
|
|
string? Notes = null);
|
|
|
|
/// <summary>
|
|
/// A converted file of the library next to its original (tappa E3, spec §4.10): <paramref name="Format"/> (wire name),
|
|
/// <paramref name="State"/> <c>pending</c>, <c>converted</c>, <c>failed</c>, <c>asIs</c> («non si converte»),
|
|
/// <c>superseded</c> or <c>removed</c>, its size, and <paramref name="Notes"/>: what was not kept, or why it failed or
|
|
/// does not convert. <paramref name="Available"/>: the file is on disk («Scarica», «Mostra nella cartella»).
|
|
/// </summary>
|
|
public sealed record MediaConversionDto(long Id, string Format, string State, long? Bytes, string? Notes, bool Available, string? FileName);
|
|
|
|
/// <summary>
|
|
/// «Copie esterne» of the account card. <paramref name="Destination"/>: the effective one (its own folder, else the
|
|
/// general folder), null when there is none. Counts are of due files (decision D3 of tappa E2): with the switch off
|
|
/// they are zero.
|
|
/// </summary>
|
|
public sealed record ExportAccountDto(
|
|
bool Enabled,
|
|
bool HasOwnFolder,
|
|
ExportDestinationDto? Destination,
|
|
int Due,
|
|
int NotCopied,
|
|
int RemovedOrSuperseded,
|
|
int Failed);
|
|
|
|
// ---------------------------------------------------------------------------------------------- frames (tappa E3)
|
|
|
|
/// <summary>
|
|
/// <c>GET /api/media/{id}/frames/info</c>: whether frames can be taken from the video (<paramref name="Unavailable"/>:
|
|
/// «Fotogramma non disponibile per questo video»), its length and its size as shown (rotation applied).
|
|
/// </summary>
|
|
public sealed record FrameInfoDto(bool Available, string? Unavailable, long DurationMs, int Width, int Height, bool HasAudio);
|
|
|
|
/// <summary>
|
|
/// One instant of a frames request: the one asked for, the one really shown (the frame's identity, ms rounded up), its
|
|
/// label («0:01,25») and the suffix of its file name (<c>_t0m01s250</c>, <c>_f001</c>).
|
|
/// </summary>
|
|
public sealed record FrameInstantDto(int Index, long RequestedMs, long ActualMs, string Label, string Suffix);
|
|
|
|
/// <summary>
|
|
/// <c>GET /api/media/{id}/frames/instants</c>: the instants of a mode for one video (at most 1.000). <paramref name="Total"/>:
|
|
/// how many it asks; <paramref name="Problem"/>: why none is given (over 1.000, not available).
|
|
/// </summary>
|
|
public sealed record FrameInstantsDto(long DurationMs, int Total, bool OverCap, string? Problem, IReadOnlyList<FrameInstantDto> Instants);
|
|
|
|
/// <summary>
|
|
/// The frames of a selection («Fotogrammi…» from the selection bars): exactly one of <paramref name="MediaIds"/>,
|
|
/// <paramref name="EntryIds"/> (every video of those entries) or <paramref name="Query"/> with <paramref name="Mode"/>,
|
|
/// and which frames.
|
|
/// </summary>
|
|
public sealed record FramesSelectionRequest(IReadOnlyList<long>? MediaIds, IReadOnlyList<long>? EntryIds, string? Query, string? Mode, FramesRequestDto? Frames);
|
|
|
|
/// <summary>
|
|
/// <c>POST /api/frames/plan</c>: what «Scarica» would give. <paramref name="NotAvailable"/>: videos without frames (or
|
|
/// not on disk); <paramref name="OverCap"/>: videos over 1.000 frames; <paramref name="TooManyToDownload"/>: more than
|
|
/// 500 frames («Nella cartella delle copie»); <paramref name="NeedsQuiet"/>: more than 20 (only outside engine sessions
|
|
/// and other long work). <paramref name="Problem"/>: why «Scarica» cannot run now; <paramref name="Summary"/>: the line
|
|
/// of the dialog («12 fotogrammi da 4 video · le 3 foto si saltano»).
|
|
/// </summary>
|
|
public sealed record FramesPlanDto(int Videos, int PhotosSkipped, int NotAvailable, int Frames, int OverCap, bool TooManyToDownload, bool NeedsQuiet, string? Problem, string Summary);
|
|
|
|
/// <summary>A download of frames ready: open <paramref name="Url"/> once within 5 minutes.</summary>
|
|
public sealed record FramesTokenDto(string Token, int Frames, string Url);
|
|
|
|
/// <summary>A converted file of the library («Mostra nella cartella»).</summary>
|
|
public sealed record ConversionActionRequest(long ConversionId);
|
|
|
|
/// <summary>
|
|
/// What «Elimina dalla libreria» would remove (tappa E3, spec §4.6): the entries, their files and the converted files of
|
|
/// 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»;
|
|
/// <paramref name="Added"/>: in the answer of start, the videos it added to the job (0 when all were queued already).
|
|
/// </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,
|
|
int Added);
|