D1, quarta parte: «Raggruppa i post» o «Tutte le foto» in Libreria e scheda account
Un post con più foto era una tessera sola: per vederle tutte bisognava aprirlo. Ora un interruttore nella riga degli strumenti (Libreria e Contenuti dell'account, non «In evidenza») passa a una tessera per file, video dei caroselli compresi, con la posizione «2/4» sulla tessera; la scelta resta nel browser, una per pagina, e il predefinito è raggruppato (§4.6). - API: /api/library e /api/library/days accettano mode=files; il cursore diventa «ms.elemento.posizione», i giorni contano file e il totale dice anche quanti file. Le finestre restano a chiavi sull'indice di pubblicazione; per i conteggi un indice ix_media_entry_files (entry_id, state, kind) nella migrazione 0002 non ancora unita. Prova di scala a 200.000 elementi: finestre 6-11 ms, conteggi 0,2-0,3 s. - Visualizzatore: si apre sul file della tessera e va di file in file, anche da un elemento al successivo («Libreria, file 12 di 30.340»). - Selezione di file; elenco CSV ed «Elimina» lavorano sugli elementi interi e lo dicono («3 file scelti appartengono a 2 elementi: elimino gli elementi interi, 9 file»). «Copia in…» non è in questo ramo. - Dimostrazione: alcune serie hanno un video in seconda posizione, scelto dall'identificativo senza toccare la sequenza casuale. - Prove di archivio, API, dimostrazione e interfaccia (queste ultime con Chromium, solo nella CI); guida e decisioni aggiornate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34fe5e9073
commit
30e159cbd4
23 files changed
+1126
-130
No files matched your search
@@ -860,9 +860,14 @@ public static class DemoSeeder
|
||||
_ => video ? (random.NextDouble() < 0.7 ? PictureShape.Story : PictureShape.Portrait) : PickShape(random),
|
||||
};
|
||||
|
||||
// «Tutte le foto» (spec §4.6): about one series of three files or more in five has a video in second place, as on
|
||||
// Instagram. Decided from the entry's own identifier, so the rest of the demo world (drawn from the same random
|
||||
// sequence) stays as it was; its length and weight too.
|
||||
var seriesVideo = !video && count >= 3 && entry.InstagramId is { Length: > 0 } id && id[^1] is '3' or '7';
|
||||
for (var n = 1; n <= count; n++)
|
||||
{
|
||||
var isVideo = video && n == 1;
|
||||
var inSeries = seriesVideo && n == 2;
|
||||
var isVideo = (video && n == 1) || inSeries;
|
||||
var picture = pool.Pick(n == 1 ? subject : spec.Themes[random.Next(spec.Themes.Length)], n == 1 || !video ? shape : PickShape(random), random);
|
||||
var extension = isVideo ? ".mp4" : ".jpg";
|
||||
var relative = layout.RelativePathFor(folder, LibraryNaming.Default.For(entry.Kind), NamingValues.For(account.Username, entry, n, extension, collection, picture.Sha256), zone);
|
||||
@@ -872,10 +877,10 @@ public static class DemoSeeder
|
||||
Kind = isVideo ? MediaKind.Video : MediaKind.Photo,
|
||||
Width = picture.Width,
|
||||
Height = picture.Height,
|
||||
Duration = isVideo ? TimeSpan.FromSeconds(item.Kind is EntryKind.Story or EntryKind.Highlight ? random.Next(5, 16) : random.Next(8, 95)) : null,
|
||||
Duration = inSeries ? TimeSpan.FromSeconds(9 + (count * 4)) : isVideo ? TimeSpan.FromSeconds(item.Kind is EntryKind.Story or EntryKind.Highlight ? random.Next(5, 16) : random.Next(8, 95)) : null,
|
||||
State = item.Imported ? MediaState.Imported : MediaState.Downloaded,
|
||||
RelativePath = relative,
|
||||
Bytes = isVideo ? random.Next(2_000_000, 38_000_000) : picture.Bytes,
|
||||
Bytes = inSeries ? 6_000_000 + (count * 900_000) : isVideo ? random.Next(2_000_000, 38_000_000) : picture.Bytes,
|
||||
Sha256 = picture.Sha256,
|
||||
PerceptualHash = isVideo ? null : picture.PerceptualHash,
|
||||
HasThumbnail = true,
|
||||
|
||||
Reference in new issue
Block a user