E2: API delle copie esterne, composizione e dimostrazione
Le copie esterne diventano usabili dall'interfaccia: ExportHub costruisce l'unico ExportService del web (segna «interrotto» ciò che l'arresto ha fermato e avvisa le pagine a lavoro finito), ExportApi espone cartelle, scelta e controllo della cartella, «Copia in…» (piano e avvio), «Copia di nuovo», avanzamento, lavori, ripresa, annullamento e resoconto. Gli endpoint esistenti portano le copie: filtro copies= della Libreria, segno «Copiato» / «Copiato in parte 1/3» sulle tessere, copie di ogni file nel visualizzatore, riquadro «Copie esterne» e interruttore «Esporta questo account» nella scheda. Una cartella di account o della libreria che finirebbe dentro (o attorno a) una cartella delle copie è rifiutata; dopo una ricostruzione le cartelle in conflitto vanno in pausa. Composizione: in Docker le copie si scrivono solo sotto /esporta, e solo con --esporta/FEBE_ESPORTA e un montaggio (riga di avvio e avviso se manca); sul desktop qualsiasi cartella con la finestra del sistema e lo spazio libero misurato anche sulle condivisioni di rete. La dimostrazione ha una cartella generale, una propria, un account non esportato e copie vere in ogni stato, scritte dal motore nella sua cartella temporanea. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a112c92893
commit
4a7925ad23
30 files changed
+2299
-32
No files matched your search
@@ -1102,13 +1102,16 @@ internal sealed class ExportStore(FebeDatabase db) : IExportStore
|
||||
c => ReadAll(c.Command(RecentRunsSql).With("@limit", (long)Math.Clamp(limit, 1, 1000)), ReadRun),
|
||||
ct);
|
||||
|
||||
public Task<IReadOnlyDictionary<long, ExportMark>> GetEntryMarksAsync(IReadOnlyList<long> entryIds, CancellationToken ct = default)
|
||||
public async Task<IReadOnlyDictionary<long, ExportMark>> GetEntryMarksAsync(IReadOnlyList<long> entryIds, CancellationToken ct = default) =>
|
||||
(await GetEntryCopyCountsAsync(entryIds, ct).ConfigureAwait(false)).ToDictionary(p => p.Key, p => p.Value.Mark);
|
||||
|
||||
public Task<IReadOnlyDictionary<long, ExportEntryCopies>> GetEntryCopyCountsAsync(IReadOnlyList<long> entryIds, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(entryIds);
|
||||
return db.ReadAsync<IReadOnlyDictionary<long, ExportMark>>(
|
||||
return db.ReadAsync<IReadOnlyDictionary<long, ExportEntryCopies>>(
|
||||
c =>
|
||||
{
|
||||
var marks = new Dictionary<long, ExportMark>();
|
||||
var marks = new Dictionary<long, ExportEntryCopies>();
|
||||
var x = ExportFilterSql.Load(c);
|
||||
if (!x.HasDestination || entryIds.Count == 0)
|
||||
{
|
||||
@@ -1128,9 +1131,7 @@ internal sealed class ExportStore(FebeDatabase db) : IExportStore
|
||||
using var r = command.ExecuteReader();
|
||||
while (r.Read())
|
||||
{
|
||||
var due = r.GetInt32(1);
|
||||
var copied = r.GetInt32(2);
|
||||
marks[r.GetInt64(0)] = copied == 0 ? ExportMark.None : copied >= due ? ExportMark.Copied : ExportMark.Partly;
|
||||
marks[r.GetInt64(0)] = new ExportEntryCopies(r.GetInt32(1), r.GetInt32(2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user