Foto del profilo: uno schema dei nomi proprio (#38)
verifica / controlli (push) Successful in 17s
verifica / prove (push) Successful in 12m21s
verifica / installatore (push) Successful in 3m45s
verifica / immagine (push) Successful in 16m5s

Alberto ha deciso che le foto del profilo stanno dentro ogni account, in
<account>\profilo. Con un solo schema generale bastava cambiarlo perché
finissero insieme ai post: ora hanno il loro schema, come le raccolte in
evidenza, predefinito {account}\profilo\{data}_{ora}_{codice}_{n}, senza la
cartella dell'anno.

Impostazioni > Generali mostra il terzo campo con la cartella nel risultato
e colora solo il campo sbagliato. Un salvataggio che non manda il terzo
schema tiene quello salvato. Importazione e ricostruzione del database
riconoscono la cartella; prove nuove per nomi, impostazioni, salvataggio,
importazione e ricostruzione. Schermata confrontata con il mockup 08.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-13 11:39:58 +01:00
1 parent 305791f57b
commit 72deb212a7
19 files changed
+340 -69

No files matched your search

+10 -1
View File
@@ -110,7 +110,16 @@ public sealed class LibraryIngestTests
var bytes = TestFile.PhotoBytes(40, 320, 320);
var saved = await library.SaveAsync(account, Make.Entry(account.Id, "pp1", Make.T0, EntryKind.ProfilePicture), [new TestFile(Make.Photo(1), bytes, ".jpg")]);
var sha = Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(bytes));
Assert.AreEqual($"profilo/2026/2026-10-13_10-00-00_{sha[..8]}_1.jpg", saved.Media[0].RelativePath);
Assert.AreEqual($"profilo/2026-10-13_10-00-00_{sha[..8]}_1.jpg", saved.Media[0].RelativePath);
// With a general scheme that puts everything in the account folder the pictures keep their own folder (#38).
library.Ingest.Apply(LibraryNaming.Default with { General = NamingScheme.Parse(@"{account}\{data}_{codice}_{n}", NamingSchemeUse.General) }, true);
var other = TestFile.PhotoBytes(41, 320, 320);
var second = await library.SaveAsync(account, Make.Entry(account.Id, "pp2", Make.T0.AddDays(1), EntryKind.ProfilePicture), [new TestFile(Make.Photo(1), other, ".jpg")]);
var otherSha = Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(other));
Assert.AreEqual($"profilo/2026-10-14_10-00-00_{otherSha[..8]}_1.jpg", second.Media[0].RelativePath);
var post = await library.SaveAsync(account, Make.Entry(account.Id, "p1", Make.T0) with { Code = "AbC1" }, [new TestFile(Make.Photo(1), TestFile.PhotoBytes(42, 320, 320), ".jpg")]);
Assert.AreEqual("2026-10-13_AbC1_1.jpg", post.Media[0].RelativePath);
var video = await library.Db.Entries.AddAsync(Make.Entry(account.Id, "big", Make.T0), [Make.Video()]);
await Assert.ThrowsExactlyAsync<FileTooLargeException>(() => library.Ingest.SaveMediaAsync(