The composer's clock button gives a post a time (scheduled_at, at least five minutes ahead; located and group posts have none), and /scheduled moves or drops what waits. A hashtag's feed tab shows its week and follows it, so its public posts come home. Explore (/explore) shows what PrivaPub says is trending, hashtags, posts and links from public posts it holds, the directory by activity or by joining, and the hashtags the persona follows. DiscoveryService does the calls; the e2e tests check each against PrivaPub's own answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
namespace decePubClient.Models.Mastodon;
|
|
|
|
/// <summary>A hashtag as PrivaPub describes it: its last week of use in public posts it holds, and whether the persona
|
|
/// follows it (null when nobody is signed in).</summary>
|
|
public class Tag
|
|
{
|
|
public string Name { get; set; }
|
|
public string Url { get; set; }
|
|
public List<TagDay> History { get; set; } = [];
|
|
public bool? Following { get; set; }
|
|
|
|
public int WeekUses => History.Sum(h => h.UsesCount);
|
|
public int TodayAccounts => History.FirstOrDefault()?.AccountsCount ?? 0;
|
|
}
|
|
|
|
/// <summary>One day of a tag's or a link's use; Mastodon sends the numbers as strings, the day as unix time.</summary>
|
|
public class TagDay
|
|
{
|
|
public string Day { get; set; }
|
|
public string Uses { get; set; }
|
|
public string Accounts { get; set; }
|
|
|
|
public int UsesCount => int.TryParse(Uses, out var n) ? n : 0;
|
|
public int AccountsCount => int.TryParse(Accounts, out var n) ? n : 0;
|
|
}
|
|
|
|
/// <summary>A link many authors shared this week: its preview card with its days.</summary>
|
|
public class TrendLink : PreviewCard
|
|
{
|
|
public List<TagDay> History { get; set; } = [];
|
|
|
|
public int WeekAccounts => History.Sum(h => h.AccountsCount);
|
|
}
|