Correzioni della revisione della catena 0.3.0, ognuna con la sua prova
- Collegamento: corretta la SyntaxError di connection.js (una «let saved» dichiarata due
volte nello stesso blocco fermava tutta la pagina). Nuova prova ScriptSyntaxTests con un
controllo scritto in casa che legge ogni modulo di wwwroot: parentesi, dichiarazioni
doppie nello stesso blocco, importazioni che il modulo di arrivo non esporta.
- HEIF: il riconoscimento dei formati prende ogni marchio che HeifDecoder accetta (mif2,
MiHE, marchi solo compatibili), così rilevazione, decodifica, misure, miniatura e
impronta concordano.
- Docker, lasciare la pagina del browser: un nuovo contratto del browser cancella l'uscita
annotata (_leftAt) anche prima che la vista si riapra, e la copia della sessione aspetta
un altro comando del collegamento al più LetGoWait invece che senza limite.
- JPEG e PNG: senza EOI o IEND la decodifica fallisce («File danneggiato o incompleto»),
la sola lettura delle misure resta tollerante.
- Visualizzatore: IsDamaged legge prima l'intestazione e il file intero solo quando può
servire, in modo asincrono e con una piccola memoria per file, così una scheda con
molti file non blocca il server.
- Importazione (§9.3): le immagini danneggiate si importano come le altre ma si segnano
nella revisione, nel resoconto e nel CSV.
- Pulizia: le prove con il limite di 5 minuti non corrono più in parallelo fra loro.
- Pila dei caratteri come l'appendice B, senza Liberation; testo di Informazioni sulle
immagini fatte in casa; guida (Problemi comuni, Sicurezza) allineata all'uscita in
Docker dalla pagina del browser.
- docs/decisioni.md: le righe del 25 novembre 2026 con i motivi, compresa l'unione 537517b
tenuta così com'è.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d234f8791
commit
2068dd28f3
35 files changed
+1366
-75
No files matched your search
@@ -322,7 +322,8 @@ public static class ImportApi
|
||||
review.CanMove,
|
||||
review.StogramHypothesis,
|
||||
review.Copied,
|
||||
[.. accounts.OrderBy(a => a.Username, StringComparer.Ordinal).Select(a => new AccountChoiceDto(a.Id, a.Username, ApiMapping.State(a.State)))]);
|
||||
[.. accounts.OrderBy(a => a.Username, StringComparer.Ordinal).Select(a => new AccountChoiceDto(a.Id, a.Username, ApiMapping.State(a.State)))],
|
||||
review.Damaged);
|
||||
}
|
||||
|
||||
public static DuplicateCaseDto Case(DuplicateCase item, IClock clock)
|
||||
@@ -373,7 +374,9 @@ public static class ImportApi
|
||||
[.. report.ImportedByAccount.Select(a => new ImportCountDto(a.Username, a.Files))],
|
||||
[.. report.AlreadyInLibraryByAccount.Select(a => new ImportCountDto(a.Username, a.Files))],
|
||||
report.Unrecognized,
|
||||
[.. report.Problems.Select(p => new ImportNoteDto(p.Path, p.Note))]);
|
||||
[.. report.Problems.Select(p => new ImportNoteDto(p.Path, p.Note))],
|
||||
report.DamagedCount,
|
||||
report.Damaged ?? []);
|
||||
}
|
||||
|
||||
private static ImportMode ParseMode(string? text) => text?.ToLowerInvariant() switch
|
||||
|
||||
@@ -227,7 +227,8 @@ public static class LibraryApi
|
||||
var local = LocalCalendar.ToLocal(entry.PublishedAt, zone);
|
||||
var accountFolder = Path.GetFileName(Path.TrimEndingDirectorySeparator(library.Layout.AccountFolder(account)));
|
||||
var avatar = await AccountsApi.AvatarAsync(storage, account.Id, ct).ConfigureAwait(false);
|
||||
var media = stored.Media.Select(m =>
|
||||
var media = new List<MediaDto>(stored.Media.Count);
|
||||
foreach (var m in stored.Media)
|
||||
{
|
||||
var relative = m.RelativePath;
|
||||
string? folder = null;
|
||||
@@ -238,7 +239,8 @@ public static class LibraryApi
|
||||
}
|
||||
|
||||
var path = files.Resolve(account, m);
|
||||
return new MediaDto(
|
||||
var damaged = await IsDamagedAsync(m, path, ct).ConfigureAwait(false);
|
||||
media.Add(new MediaDto(
|
||||
m.Id,
|
||||
m.Position,
|
||||
ApiMapping.Media(m.Kind),
|
||||
@@ -251,8 +253,8 @@ public static class LibraryApi
|
||||
m.HasThumbnail && m.Sha256 is not null ? m.Sha256 : m.Kind == MediaKind.Video ? "video" : null,
|
||||
path is not null,
|
||||
ApiMapping.State(m.State),
|
||||
IsDamaged(m, path));
|
||||
}).ToList();
|
||||
damaged));
|
||||
}
|
||||
|
||||
return new EntryDto(
|
||||
entry.Id,
|
||||
@@ -277,10 +279,12 @@ public static class LibraryApi
|
||||
/// <summary>
|
||||
/// «File danneggiato o incompleto» (spec §4.6, §8.4): a photo on disk with no thumbnail whose bytes are damaged or
|
||||
/// truncated. A photo with a thumbnail was decoded when it was stored, so only those without one are looked at,
|
||||
/// one file each time the viewer opens it; the file is only read, never touched (rule 12).
|
||||
/// one file each time the viewer opens it, with asynchronous reads and the answer kept for the same file; a format
|
||||
/// Febe does not decode, a HEIC or a picture over the limit is told from its first bytes, without reading it whole.
|
||||
/// The file is only read, never touched (rule 12).
|
||||
/// </summary>
|
||||
private static bool IsDamaged(Media media, string? path) =>
|
||||
media.Kind == MediaKind.Photo && !media.HasThumbnail && path is not null && DamagedImage.IsFileDamaged(path);
|
||||
private static async Task<bool> IsDamagedAsync(Media media, string? path, CancellationToken ct) =>
|
||||
media.Kind == MediaKind.Photo && !media.HasThumbnail && path is not null && await DamagedImage.IsFileDamagedAsync(path, ct).ConfigureAwait(false);
|
||||
|
||||
private static async Task<(Account Account, Media Media)> MediaAsync(IFebeStorage storage, long mediaId, CancellationToken ct)
|
||||
{
|
||||
|
||||
@@ -311,7 +311,8 @@ public sealed record ImportReviewDto(
|
||||
bool CanMove,
|
||||
bool StogramHypothesis,
|
||||
int Copied,
|
||||
IReadOnlyList<AccountChoiceDto> Accounts);
|
||||
IReadOnlyList<AccountChoiceDto> Accounts,
|
||||
int Damaged);
|
||||
|
||||
/// <summary>Sets where a folder goes. <see cref="Kind"/>: none, existing (with <see cref="AccountId"/>), newArchiveAccount (with <see cref="Username"/>).</summary>
|
||||
public sealed record FolderTargetRequest(string Folder, string Kind, long? AccountId, string? Username);
|
||||
@@ -340,4 +341,6 @@ public sealed record ImportReportDto(
|
||||
IReadOnlyList<ImportCountDto> ImportedByAccount,
|
||||
IReadOnlyList<ImportCountDto> AlreadyInLibraryByAccount,
|
||||
IReadOnlyList<string> Unrecognized,
|
||||
IReadOnlyList<ImportNoteDto> Problems);
|
||||
IReadOnlyList<ImportNoteDto> Problems,
|
||||
int DamagedCount,
|
||||
IReadOnlyList<string> Damaged);
|
||||
@@ -31,7 +31,7 @@
|
||||
--r-pannello:10px;
|
||||
--r-dialogo:14px;
|
||||
--tratteggio:rgba(0,0,0,.075);
|
||||
--carattere:system-ui,"Segoe UI",Roboto,Cantarell,"Noto Sans","Liberation Sans",sans-serif;
|
||||
--carattere:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
|
||||
}
|
||||
[data-tema="scuro"]{
|
||||
--fondo:#1B1B1B;
|
||||
|
||||
@@ -328,7 +328,7 @@ export function savedSessionBox(saved, page) {
|
||||
// Neither choice is shown as chosen, and neither can be picked, until the server says which one is stored: the page
|
||||
// never claims a choice the next copy will not follow. Once Alberto picks one, a late answer no longer changes it;
|
||||
// a choice the server did not save goes back to the one before.
|
||||
let saved = null;
|
||||
let stored = null;
|
||||
let chosen = false;
|
||||
const show = (value) => {
|
||||
keep.input.checked = value === 'tieni-completa';
|
||||
@@ -336,10 +336,10 @@ export function savedSessionBox(saved, page) {
|
||||
};
|
||||
const choose = async (value) => {
|
||||
chosen = true;
|
||||
const before = saved;
|
||||
const before = stored;
|
||||
try {
|
||||
const settings = await api('/api/connection/settings', { method: 'PUT', body: { incompleteCopy: value } });
|
||||
saved = settings && settings.incompleteCopy ? settings.incompleteCopy : value;
|
||||
stored = settings && settings.incompleteCopy ? settings.incompleteCopy : value;
|
||||
unknown.hidden = true;
|
||||
toast(k('salvato'));
|
||||
} catch (error) {
|
||||
@@ -353,8 +353,8 @@ export function savedSessionBox(saved, page) {
|
||||
for (const choice of [replace, keep]) choice.input.disabled = true;
|
||||
api('/api/connection/settings', { signal: page && page.signal }).then((settings) => {
|
||||
if (chosen) return;
|
||||
saved = settings.incompleteCopy;
|
||||
show(saved);
|
||||
stored = settings.incompleteCopy;
|
||||
show(stored);
|
||||
}).catch(() => {
|
||||
if (page && page.signal && page.signal.aborted) return; // the page was left
|
||||
if (!chosen) unknown.hidden = false;
|
||||
|
||||
@@ -351,7 +351,8 @@ async function reviewStep(ctx, run) {
|
||||
function drawNotes() {
|
||||
fill(notes,
|
||||
review.recognized > 0 ? h('div.avviso', icon('info', 's'), h('span', t('importa.revisione.riconosciuti', { n: number(review.recognized) }))) : null,
|
||||
review.stogramHypothesis ? h('div.avviso.ambra', icon('triangle-alert', 's'), h('span', t('importa.revisione.stogram'))) : null);
|
||||
review.stogramHypothesis ? h('div.avviso.ambra', icon('triangle-alert', 's'), h('span', t('importa.revisione.stogram'))) : null,
|
||||
review.damaged > 0 ? h('div.avviso.ambra', icon('triangle-alert', 's'), h('span', t('importa.revisione.danneggiati', { n: number(review.damaged) }))) : null);
|
||||
}
|
||||
|
||||
// The fixed bar: Copia/Sposta, what stays out, CSV, «Importa N file».
|
||||
@@ -482,6 +483,9 @@ async function reportStep(ctx, run) {
|
||||
h('section', h('h2', t('importa.resoconto.giaPerAccount')), h('div.pannello', accounts(report.alreadyInLibraryByAccount)))),
|
||||
report.unrecognized.length ? h('section.blocco', h('h2', t('importa.resoconto.nonRiconosciuti')),
|
||||
h('div.pannello', h('ul.elenco-semplice', report.unrecognized.map((u) => h('li.dati', u))))) : null,
|
||||
report.damaged.length ? h('section.blocco', h('h2', t('importa.resoconto.danneggiati')),
|
||||
h('div.pannello', h('ul.elenco-semplice', report.damaged.map((u) => h('li.dati', u))),
|
||||
report.damagedCount > report.damaged.length ? h('p.aiuto', t('importa.resoconto.danneggiatiAltri', { n: number(report.damagedCount - report.damaged.length) })) : null)) : null,
|
||||
report.problems.length ? h('section.blocco', h('h2', t('importa.resoconto.problemi')),
|
||||
h('div.pannello', h('ul.elenco-semplice', report.problems.map((p) => h('li', h('span.dati', p.path), h('span.muto', p.note)))))) : null,
|
||||
h('div.riga-azione',
|
||||
|
||||
@@ -845,7 +845,7 @@
|
||||
{ "nome": "WebView2", "testo": "solo versione Windows, licenza Microsoft" }
|
||||
],
|
||||
"leggiLicenza": "Leggi la licenza",
|
||||
"fattoInCasa": "Il carattere è quello del tuo sistema e le icone sono disegnate per Febe: nessun carattere né icona di terzi."
|
||||
"fattoInCasa": "Il carattere è quello del tuo sistema e le icone sono disegnate per Febe; le immagini (miniature, impronte visive, fotogrammi dei video) le legge e le disegna il codice di Febe: nessun carattere, icona o componente di terzi."
|
||||
}
|
||||
},
|
||||
"browser": {
|
||||
@@ -936,7 +936,8 @@
|
||||
"nessunNome": "Nessun nome di account riconosciuto",
|
||||
"esistenti": "Account in Febe",
|
||||
"riconosciuti": "Dai nomi dei file Febe ha ricavato data e codice di {n} elementi: quando terrà aggiornati questi account non li riscaricherà.",
|
||||
"stogram": "I nomi sono stati letti con l'ipotesi su 4K Stogram, non ancora verificata: controlla date e codici prima di importare."
|
||||
"stogram": "I nomi sono stati letti con l'ipotesi su 4K Stogram, non ancora verificata: controlla date e codici prima di importare.",
|
||||
"danneggiati": "File danneggiato o incompleto: 1 immagine troncata o rovinata. Si importa come le altre, ma senza miniatura né impronta visiva.|File danneggiato o incompleto: {n} immagini troncate o rovinate. Si importano come le altre, ma senza miniatura né impronta visiva."
|
||||
},
|
||||
"doppioni": {
|
||||
"titolo": "Doppioni probabili",
|
||||
@@ -997,6 +998,8 @@
|
||||
"perAccount": "Importati per account",
|
||||
"giaPerAccount": "Già in libreria, per account",
|
||||
"nonRiconosciuti": "Non riconosciuti",
|
||||
"danneggiati": "File danneggiato o incompleto",
|
||||
"danneggiatiAltri": "e altri {n}: sono tutti nell'elenco CSV.",
|
||||
"problemi": "Da guardare",
|
||||
"nessuno": "Nessuno",
|
||||
"nuova": "Nuova importazione",
|
||||
|
||||
Reference in new issue
Block a user