Add "flat" front history view (percentages add up to 100%)

This commit is contained in:
spiral
2021-06-21 11:30:38 -04:00
parent bc32943824
commit c727a71161
5 changed files with 38 additions and 11 deletions

View File

@@ -523,8 +523,9 @@ namespace PluralKit.Bot
title.Append($"`{targetSystem.Hid}`");
var ignoreNoFronters = ctx.MatchFlag("fo", "fronters-only");
var showFlat = ctx.MatchFlag("flat");
var frontpercent = await _db.Execute(c => _repo.GetFrontBreakdown(c, targetSystem.Id, target.Id, rangeStart.Value.ToInstant(), now));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, targetSystem, target, targetSystem.Zone, ctx.LookupContextFor(targetSystem), title.ToString(), ignoreNoFronters));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, targetSystem, target, targetSystem.Zone, ctx.LookupContextFor(targetSystem), title.ToString(), ignoreNoFronters, showFlat));
}
private async Task<PKSystem> GetGroupSystem(Context ctx, PKGroup target, IPKConnection conn)

View File

@@ -135,8 +135,9 @@ namespace PluralKit.Bot
title.Append($"`{system.Hid}`");
var ignoreNoFronters = ctx.MatchFlag("fo", "fronters-only");
var showFlat = ctx.MatchFlag("flat");
var frontpercent = await _db.Execute(c => _repo.GetFrontBreakdown(c, system.Id, null, rangeStart.Value.ToInstant(), now));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, system, null, system.Zone, ctx.LookupContextFor(system), title.ToString(), ignoreNoFronters));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, system, null, system.Zone, ctx.LookupContextFor(system), title.ToString(), ignoreNoFronters, showFlat));
}
}
}