D1, seconda parte: «Cosa scaricare prima» anche per account, reel distinti e quota per chi aspetta
L'ordine dei tipi (storie, evidenza, post, reel, taggati) ora vale anche per il singolo account: nella scheda account → Impostazioni si sceglie «Come le impostazioni generali» o un ordine suo, con lo stesso elenco da trascinare (o Su/Giù da tastiera) di Limiti e comportamento, ora un modulo solo (download-order.js). Il motore pesa le visite con l'ordine dell'account, la coda dei file mette ogni file al posto del suo tipo nell'ordine del suo account, stabile dentro il tipo (scadenza, scoperta, elemento, posizione). Perché nessun tipo resti fermo per sempre quando il tetto dei dati finisce prima della coda, un posto su otto di ogni giro della coda va al file che aspetta da più tempo, di qualunque tipo. I reel non si inventano (regola 9): un post è reel se viene dalla scheda Reel o se la risposta ha product_type «clips», valore visto nei campioni ripuliti. Il segno si scrive da solo e non si toglie mai, così una copia vecchia non sposta di nuovo i file in coda. Migrazione 0002_ordine_scaricamento (account.download_order, entry.is_reel): prende il primo numero dopo quelle unite, E1 userà il successivo. Prove su motore (seme fisso), coda, lettori, ricette e API; dimostrazione con un account che ha l'ordine suo; guida e decisioni aggiornate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d6c0ef851d
commit
0547c747c5
40 files changed
+775
-158
No files matched your search
@@ -119,6 +119,13 @@ public sealed record Account
|
||||
|
||||
public AccountLimits Limits { get; init; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// «Cosa scaricare prima» of this account (spec §4.4, §7.2, tappa D1): the stored text of its own order (the Italian
|
||||
/// names of the five kinds, read by <c>Febe.Core.Engine.DownloadOrder.Parse</c>). Null: «Come le impostazioni
|
||||
/// generali».
|
||||
/// </summary>
|
||||
public string? DownloadOrder { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Folder of the account. Null means the default <c><Libreria>/<username></c>; a relative path is relative
|
||||
/// to the library (a renamed account keeps its old folder this way); an absolute path may be outside the library.
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace Febe.Core.Domain;
|
||||
|
||||
/// <summary>
|
||||
/// A type of «Cosa scaricare prima» (spec §7.2, tappa D1): the kinds of recipes of §6.3, grouped as Alberto names them.
|
||||
/// The order of the kinds is <c>Febe.Core.Engine.DownloadOrder</c>.
|
||||
/// </summary>
|
||||
public enum DownloadKind
|
||||
{
|
||||
/// <summary>«Storie»: Storie di un account.</summary>
|
||||
Stories,
|
||||
|
||||
/// <summary>«Evidenza»: Raccolta in evidenza.</summary>
|
||||
Highlights,
|
||||
|
||||
/// <summary>«Post»: Controllo del profilo and Storico, profile pictures included.</summary>
|
||||
Posts,
|
||||
|
||||
/// <summary>«Reel»: Reel, and in the queue the posts Febe knows to be reels (<see cref="Entry.IsReel"/>).</summary>
|
||||
Reels,
|
||||
|
||||
/// <summary>«Taggati»: Taggati.</summary>
|
||||
Tagged,
|
||||
}
|
||||
@@ -50,6 +50,13 @@ public sealed record Entry
|
||||
/// <summary>For stories: when the story stops being available on the site (downloads give them precedence).</summary>
|
||||
public DateTimeOffset? ExpiresAt { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// A post that Febe knows to be a reel (spec §7.2, tappa D1): found in the Reel tab, or marked so in the response.
|
||||
/// Only for <see cref="EntryKind.Post"/>; once known it stays (the store never clears it). It weighs only on the queue of the files («Cosa
|
||||
/// scaricare prima»): a reel is a post everywhere else.
|
||||
/// </summary>
|
||||
public bool IsReel { get; init; }
|
||||
|
||||
/// <summary>The value of the <c>{codice}</c> placeholder (spec §4.3) for this entry.</summary>
|
||||
/// <param name="sha256">SHA-256 of the file, needed for profile pictures (first eight hex digits).</param>
|
||||
public string NameCode(string? sha256 = null) => Kind switch
|
||||
|
||||
@@ -76,7 +76,11 @@ public sealed record Media
|
||||
public sealed record MediaLocation(Media Media, Entry Entry, string Username);
|
||||
|
||||
/// <summary>A file waiting for the download queue (spec §6.5), with what the queue needs to order it.</summary>
|
||||
public sealed record PendingDownload(Media Media, long AccountId, EntryKind Kind, DateTimeOffset PublishedAt, DateTimeOffset? ExpiresAt);
|
||||
public sealed record PendingDownload(Media Media, long AccountId, EntryKind Kind, DateTimeOffset PublishedAt, DateTimeOffset? ExpiresAt)
|
||||
{
|
||||
/// <summary>The entry is a post Febe knows to be a reel (<see cref="Entry.IsReel"/>): «Reel» in «Cosa scaricare prima».</summary>
|
||||
public bool IsReel { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>What the safe writer and the hashing produced for a file now on disk.</summary>
|
||||
/// <param name="RelativePath">Path relative to the account folder, '/' separated.</param>
|
||||
|
||||
Reference in new issue
Block a user